Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have found a possible solution, which works for me in WP3.7.1 (I haven't tested it in earlier versions)</p> <p>Create a filter, which overrides the default upload directories:</p> <pre><code>add_filter('upload_dir', 'ms_global_upload_dir'); function ms_global_upload_dir($uploads) { $ms_dir = '/sites/' . get_current_blog_id(); $uploads['path'] = str_replace($ms_dir, "", $uploads['path']); $uploads['url'] = str_replace($ms_dir, "", $uploads['url']); $uploads['basedir'] = str_replace($ms_dir, "", $uploads['basedir']); $uploads['baseurl'] = str_replace($ms_dir, "", $uploads['baseurl']); return $uploads; } </code></pre> <p>Important: the 'Upload Url Path' settings should be empty in Site Settings or if you need to customize it, check the results by dumping the <code>$uploads</code> array to view possible conflicts.</p> <p>To check if your version of WP supports this method, locate function <code>wp_upload_dir()</code> in file wp-includes/functions.php and find function call: <code>$uploads = apply_filters( 'upload_dir' ...</code> If it presents, the solution above should work.</p> <p>Hope, this helps ...</p> <p>Additionally, I have spent almost two days to make a solution to replicate/delete the uploaded media in each of the blogs with action hooks 'add_attachment' and 'delete_attachment' by generating the necessary post and postmeta entries in the corresponding database tables. With this, you can add/delete media in any of the blogs, that will be visible in/removed from all blogs media library. If you are interested, I can share it...</p> <p>Cheers</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload