Multisite Global Media is a WordPress plugin which shares media across the Multisite network.
This small plugin adds a new tab to the media modal which gives you the opportunity to share media from one site to all the other sites of the network. The multisite-global-media.php
file uses the ID of the site that will store the global media. Currently the Site ID is set at const SITE_ID = 3
. Change this value to set one of the other sites as the default for storing global media. You can also set/change this Site ID via filter hook global_media.site_id
, like add_filter( 'global_media.site_id', 1234 );
.
To get Global Media to work one has to follow these steps:
- Decide on which blog/site that will host shared media for the network.
- Add media to the media library for the specific blog/site.
- Find the ID of a site by going to All Sites section hovering over the site checking the left bottom status bar or installing a plugin that shows the ID's of each site. An comfortable enhancement in the Multisite context is the plugin Multisite Enhancement.
- Open the file
multisite-global-media.php
go to the following code:
/**
* Id of side inside the network, there store the global media
* Select the ID of the site/blog to where you want media that will be shared across the network to be stored.
*
* @var integer
* @since 2015-01-22
*/
const SITE_ID = 3;
Normally we you should not change the source. It is much easier for maintenance and other points. So if you familiar with code in the WordPress context, use the hook below to change the default Site ID of the plugin with a small custom plugin.
The plugin defines the hook global_media.site_id
to set an ID for the network Site, that store the media files, like add_filter( 'global_media.site_id', 1234 );
.
- Download the plugin as zip, use a clone of the repo or use Composer, see below
- Install the plugin in your environment, recommend as Must Use plugin, also here a small hint for an helping solution Must Use Loader.
- Set the side ID for the Global Mediathek, see above the description to change them inside the source or use the hook.
- Active the plugin for the hole network
The plugin is also available as Composer package.
composer require bueltge/multisite-global-media
Crafted by Inpsyde · Engineering the web since 2006.
Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues.
Good news, this plugin is free for everyone! Since it's released under the MIT, you can use it free of charge on your personal or commercial blog.
The plugin is designed and developed by team members from the Inpsyde crew. Special thanks and praise to Dominik Schilling for his quick help.
Please let me know if you like the plugin or you hate it or whatever ...
Please fork it, add an issue for ideas and bugs.
I'm German and my English might be gruesome here and there. So please be patient with me and let me know of typos or grammatical parts. Thanks