This plugin adds a new tab to the “Add Media” window, allowing you to access media in other blogs.
It can be very helpful when you use Multisite Language Switcher plugin for setting up a multilingual site as it prevents the editors from having to upload images twice.
Based on a blogpost by Aaron Eaton.
Also see https://github.com/joostdekeijzer/wp_network_shared_media
- Download the plugin
- Uncompress it with your preferred unzip program
- Copy the entire directory in your plugin directory of your WordPress blog (/wp-content/plugins)
- Network-activate the plugin
- Edit a post or create a new one
- Open the Add Media popup -> see the new tab!
- Editing an image in WordPress 3.9 shows the wrong image!
Yes, I know 🙁
Starting from WordPress 3.9, when editing an image in the post editor, the original image data is retrieved from the server using only the image id. Using NSM, this will be the ID from a different blog. When, by coincidence, the current blog also has an attachment with that ID, the information for that image is displayed.
v0.10.0 of my plugin has a fix for newly inserted images, but old embeds will not be changed (please see this forum post for more info).
If you encounter this, the most straight-forward solution is to:
- Cancel the image edit
- Go to the text view of the post
- When your image has a caption, clear the id attribute of the caption shortcode
- Also remove the
wp-att-<id>classes from the image tag
- Return to Visual mode and try and edit the image again
Sorry for the inconvenience…
- About Permissions
This plugin depends on the global WordPress blog permissions for viewing and editing Media.
Only blogs where the user has ‘upload_files’ permission are shown in the Network Shared Media tab.
If a user doesn’t have the ‘upload_files’ permission on the current (active) blog, the tab isn’t shown at all since that user can’t access the Add Media pop-up window.
- I still can’t see the site listed!
A site can have several attributes which can be set through /wp-admin/network/sites.php .
This plugin only shows sites which attributes are set as follows:
- Public: true
- Archived: false
- Spam: false
- Delete: false
- Mature: ignored
Using it on my MU site, tweaked it slightly so it only pulls from one site that I want its media library shared with all others, but only that one. Gives my users access to a media library I manage only.
Seems to work well, thanks.
Great idea, implementation needs some work though, even though you can see the images across the network of subsites, you can not insert media, only paste urls but referencing other sites,
Implementing a feature to “share across network” only individual images would be ideal, since we don’t want to share every image, since they are own by different sites operators, but just some placeholders for newly created sites.
Good overall, does what it claims it does on the default mode, but not on multisite, at least v4.4.2.
This is a great plugin to share images between sites. Be sure to add the Multisite Featured Image plugin to get Featured Image support. These both worked fine for me on my WordPress 4.4.2 installation.
The only “rough edge” for me was understanding that you don’t simply click on the image to add it. You have to select “Show” and then “Insert into Post” to complete the operation.
Thanks Joost! Well done!
I have tried it (Three times) on my wordpress multisite version 4.4.1–en_GB but not been able to get it to work.
This is a shame as it promises to be worth having.
I see the last update as 6 months ago – are there any plans to update it again or more often?
But a little bit tricky…
Nice tool anyway!
Contributors & Developers
“Network Shared Media” is open source software. The following people have contributed to this plugin.Contributors
Interested in development?
- Removed media-upload.php file and the direct request for it. It was incompatible with setups where the plugins directory had been moved. Now, requests are done through /wp-admin/admin-ajax.php.
- Tested with WordPress 4.3
- Added German translation (by realloc)
- Changes all image/caption id’s and id-dependent classnames to include
nsm-<site_id>-<id>to circumvent WordPress 3.9 editor issues (see FAQ or this forum post)
- New “base” for the insertion code
- Supports Video and Audio shortcode insertion
- Bugfix where, after selecting an image, reopening the Media Browser would result in an empty screen.
- Tested with WordPress 3.8.
- Added translations for Spanish (es_ES by Juan Ignacio Rodriguez) and Serbo-Croatian (sr_RS by Borisa Djuraskovic). Thank you!
- Bugfix for newer WordPress where original media tabs would show.
- Minor bugfix for WP3.5 (remove the “Edit picture” button)
- Set is_admin() to true, fixing issues with Contact Form 7 (and possibly others)
- bugfix for cross-domain errors in “multiple domain” installations
- some speed improvements
- sorting of sites
- When many sites are available, the site-selection becomes a drop-down list (as suggested by SooBahkDo)
- Ignore “mature” site attribute
- tested with WP3.4RC
- fixed some embarrassing typos
- i18n (feel free to contact me for translations)
- Updated read-me
- Added screenshot
- fixed bug where restore_current_blog would give unexpected results (when number of sites > 2)
- checking for correct permissions: upload_files permission required for both the “active” site as the networked sites
- to reduce server load: choose blog to display media of (in stead of just showing them all)
- first public version