{"id":131888,"date":"2014-09-20T11:30:00","date_gmt":"2014-09-20T15:30:00","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=131888"},"modified":"2014-09-19T20:03:33","modified_gmt":"2014-09-20T00:03:33","slug":"how-to-share-media-across-wordpress-multisite","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/how-to-share-media-across-wordpress-multisite\/","title":{"rendered":"How To Share Media Across WordPress Multisite"},"content":{"rendered":"<p>WordPress multisite installs might use a single codebase but when it comes to media each site operates in its own silo.<\/p>\n<p>If you are using multisite to publish multiple sites then reusing media across your sites either means inserting with a url or loading the image up twice. Hardly satisfactory.<\/p>\n<p>In this Weekend WordPress project, we&#8217;ll take a look at\u00a0how to share images, video and audio across your site, saving you considerable time, trouble and disk space.<\/p>\n<p><!--more--><\/p>\n<figure id=\"attachment_132215\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-large wp-image-132215\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/09\/wwp-network-shared-media-700x218.jpg\" alt=\"Featured image\" width=\"700\" height=\"218\" \/><figcaption class=\"wp-caption-text\">Sharing media across your multisite has enormous time saving benefits<\/figcaption><\/figure>\n<p>The <a title=\"Read more about this plugin on the WordPress plugin repository\" href=\"https:\/\/wordpress.org\/plugins\/network-shared-media\/\" target=\"_blank\">Network Shared Media plugin<\/a> by <a title=\"Visit Joost's website\" href=\"http:\/\/dekeijzer.org\/\" target=\"_blank\">Joost de Keijzer<\/a> does exactly what it says on the tin: allows media to be shared across a WordPress multisite network.<\/p>\n<p>Why is this important? In a default multisite install each site has its own media library, with no built-in capabilities to easily access media from other sites. The choices are either use the <em>Insert from URL<\/em> facility or load up the image into each site.<\/p>\n<p>If you have a widely used set of images, such as logos or icons or portraits, then you have to either link to the original source (and trust that the URL doesn&#8217;t change) or load each item up in the site where you want to use it.<\/p>\n<p>Clearly, the better\u00a0option is to be able to select media from any site on the multisite network for insertion into a post and to not have to duplicate it. And preferably, have the URL\u00a0look and feel as if it is local to the post&#8217;s site.<\/p>\n<p>This is exactly what Network Shared Media provides.<\/p>\n<p>Installing and network activating the plugin (there&#8217;s no need to activate on the individual sites) adds a new option, <em>Network Shared Media<\/em> to the Add Media dialog:<\/p>\n<figure id=\"attachment_132214\" class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-132214\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2014\/09\/network-shared-media.jpg\" alt=\"Screengrab of the Add Media dialog showing hte Network Shared Media link and the individual blog links\" width=\"700\" height=\"564\" \/><figcaption class=\"wp-caption-text\">A new Network Shared Media option give\u00a0you access to any network site&#8217;s media<\/figcaption><\/figure>\n<p>Clicking on this new option, displays the media as normal but creates a new menu bar with links to each site on the network. Clicking on a site brings up the media for that site.<\/p>\n<p>Selecting and inserting a media item is exactly as before (clicking on the Insert into Post button) but what&#8217;s interesting is that the plugin localizes the URLs, so although there is only one source, the URL is for the current blog, not the original.<\/p>\n<p>For example, here&#8217;s the <em>img<\/em> tag and <em>a<\/em> tag for an image inserted into a post on Blog A but that physically actually resides in the primary site&#8217;s uploads folder (http:\/\/www.multisite.dev\/wp-content\/uploads).<\/p>\n<p><code><br \/>\n&lt;a href=\"http:\/\/www.multisite.dev\/bloga\/wp-content\/uploads\/2014\/09\/iphone3.png\"&gt;<br \/>\n&lt;img class=\"alignnone size-medium wp-image-nsm-1-11\"<br \/>\nsrc=\"http:\/\/www.multisite.dev\/bloga\/wp-content\/uploads\/2014\/09\/iphone3-155x300.png\"<br \/>\nalt=\"\" width=\"155\" height=\"300\" \/&gt;<br \/>\n&lt;\/a&gt;<br \/>\n<\/code><\/p>\n<h3>No Featured Image Support<\/h3>\n<p>The only real drawback with the plugin is that it&#8217;s functionality doesn&#8217;t extend to the Featured Image selection tool.<\/p>\n<p>This is not really the plugin&#8217;s fault as, and I hadn&#8217;t ever noticed this before, the Featured Image dialog is not the same as the Add Media button. It only\u00a0allows for picking directly from the site&#8217;s media library or uploading a new item and doesn&#8217;t support Add Media functionality such as Insert from URL.<\/p>\n<h3>One For The Multisite Publisher&#8217;s Essential Plugin List?<\/h3>\n<p>If you use WordPress in multisite mode to manage several websites, then this plugin offers a time-saving way of sharing common media across those sites.<\/p>\n<p>For that reason alone, it&#8217;s a prime contender for the Essential Plugin list for WordPress multisite operators.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharing media across your WordPress multisite has enormous time saving benefits and is simple to set up.<\/p>\n","protected":false},"author":262394,"featured_media":132215,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[1117,263],"tags":[3361,9958,9798],"tutorials_categories":[],"class_list":["post-131888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-multisite","category-tutorials","tag-media","tag-multisite-2","tag-weekend-wordpress-projects"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/131888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/262394"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=131888"}],"version-history":[{"count":0,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/131888\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/132215"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=131888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=131888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=131888"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=131888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}