GithubHelp home page GithubHelp logo

humanmade / multisite-global-media Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bueltge/multisite-global-media

3.0 12.0 2.0 736 KB

Share an media library across multisite network

License: MIT License

CSS 0.28% JavaScript 51.82% PHP 47.90%

multisite-global-media's Introduction

Multisite Global Media

Multisite Global Media is a WordPress plugin which shares media across the Multisite network.

Description

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:

  1. Decide on which blog/site that will host shared media for the network.
  2. Add media to the media library for the specific blog/site.
  3. 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.
  4. 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.

Hook for Site ID

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 );.

Installation

  • 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 whole network

Composer

The plugin is also available as Composer package.

composer require bueltge/multisite-global-media

Screenshots

Media Modal

Usage in Featured Image

Other Notes

Crafted by Inpsyde · Engineering the web since 2006.

Bugs, technical hints or contribute

Please give me feedback, contribute and file technical bugs on this GitHub Repo, use Issues.

License

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.

Contact & Feedback

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.

Disclaimer

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

multisite-global-media's People

Contributors

bueltge avatar christhompsontldr avatar gnowland avatar magicworks avatar oxyc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.