I'm working on a template that basically sets up WP in the following manner:

  • /
  • /wp
  • /content/plugins
  • /content/themes
  • /media

Using the /media folder to store and serve uploads on single-site installs is easy enough:

add_filter('pre_option_upload_path',      function($val) { return '../media'; });
add_filter('pre_option_upload_url_path',  function($val) { return '/media'; });

It seems a bit less trivial to change for multi-site installs. A cursory look in the WP code yields functions like ms_upload_constants() and all sorts of checks related to is_multisite() whenever uploads occur, and cursory googling yields little to nothing.

Is there a documented procedure to make a WP multisite do a similar trick with /media/$site_id in the above setup? Or is it primarily a matter of tricking WP into writing into the correct location by using symb links (or something to that order)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.