• Stars
    star
    215
  • Rank 183,925 (Top 4 %)
  • Language
    PHP
  • License
    GNU General Publi...
  • Created almost 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Share a media library across the WordPress Multisite network

Multisite Global Media

Build Status Scrutinizer Code Quality Php Min Version MIT License

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

Description

This small plugin adds a new tab to the media library, which allows you to share media from one site to all the other sites of the network. By default, the Site ID is set to '1'. You can set/change this Site ID via the filter hook global_media.site_id which is run in a custom plugin like so

add_filter( 'global_media.site_id', function() {
    return 1234;
} );

To get Global Media to work, please follow these steps:

  1. Decide which blog/site will host the shared media for the network.
  2. Add media to the media library for the chosen blog/site.
  3. Find the Site ID of your chosen site by going to your Network WP Admin. In the left-hand menu, choose "All Sites", and then click on "edit" under the site you need. In the address bar, you will see site-info.php?id=4 where the last number is the ID.

Finding the site ID

  1. If the Site ID of your chosen site is '1', then you don't need to make any changes. If it's a different ID number, then please read the section below about modifying the Site ID via hook and a custom plugin.

Note: A useful enhancement in the Multisite context is the plugin Multisite Enhancement. It also helps to identify the site and get his site ID.

Set your Site ID for the Global Mediathek

If you need to change the default Site ID '1' to another value, then you can do so by creating a small custom plugin.

  1. In /wp-content/mu-plugins/ create a new folder mgm-set-my-site-id.
  2. In /wp-content/mu-plugins/mgm-set-my-site-id/ create a new file mgm-set-my-site-id.php.
  3. Add the following content to 'my-plugin.php'. Change the return value to your chosen Site ID.
<?php
/**
* Plugin Name: Multisite Global Media Site ID
* Plugin URI:  https://github.com/bueltge/multisite-global-media/
* Description: Set my Multisite Global Media site in the network.
* Version:     1.0.0
* Network:     true
*/

add_filter( 'global_media.site_id', function() {
   return 1234;
} );
  1. Activation is not necessary if you store this plugin inside the Must Use Plugin directory /wp-content/mu-plugins/.

Installation

Manual

  • Download the plugin as zip (available inside the release), use a clone of the repo or use Composer, see below.
  • Install the plugin in your environment, recommend as Must Use plugin.
  • Optional: See here for a quick hint for a helping solution Must Use Loader. This plugin is not necessary, but helpful if you use more as one plugin as Must Use plugin and use it in sub-directories.
  • Set the Site ID for the Global Media Library, see above the description to change the ID with a hook in a custom plugin.
  • Active the plugin for the whole network if you don't store it as Must Use Plugin.

Composer

The plugin is also available as Composer package.

composer require bueltge/multisite-global-media

Screenshots

Media Modal

Usage in Featured Image

Contributing

Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

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 GPLv2+.

Contact & Feedback

The plugin is designed and developed by team members from the Inpsyde crew. Special thanks and praise to Dominik Schilling and Guido Scialfa for his help and engagement.

Please let me know if you like the plugin or you hate it or whatever.

Please fork it and improve the plugin. However, see the Contributing note above. Add an issue for ideas and bugs. Also, we say thank you for improvements in the documentation and help in the support.

Disclaimer

We don't speak the English language natively, and maybe it might be gruesome here and there. So please be patient with me and let me know of typos or grammatical errors. Thank you!

More Repositories

1

wordpress-admin-style

This plugin reference elements from wp-admin in an overview with the necessary markup and CSS classes to help you to develop WordPress compliant.
PHP
958
star
2

wordpress-multisite-enhancements

Enhance WordPress Multisite for Network Admins with different topics
PHP
104
star
3

debug-objects

WordPress Plugin for debugging and learning with and at the application.
PHP
104
star
4

remove-comments-absolutely

WordPress Plugin to deactivate comments functions and remove areas absolute form the WordPress install
PHP
98
star
5

Free-Web-Font-Combinations

Beautiful web type combinations
CSS
96
star
6

wordpress-basis-theme

I'm a WordPress starter theme.
PHP
67
star
7

wp-rest-api-filter-items

A WordPress plugin that filters WP REST API items to your requirement.
PHP
64
star
8

must-use-loader

This small WordPress plugin include all plugins in subdirectories from Must Use plugin folder
PHP
63
star
9

MantisBT-Colorized

Just another theme for Mantis BugTracker.
CSS
61
star
10

wp-offline

Use WordPress without all online-checks. Deactivate autoupdate for core, plugins and themes
PHP
49
star
11

WordPress-Starter

This is simple starter skeleton repo for a WordPress developer site.
PHP
47
star
12

de-DE

Special German permalink sanitize
PHP
43
star
13

Documentation

A small Theme for WordPress as a documentation-tool.
PHP
40
star
14

WP-Contact-Form-Template

A simple contact form template for use inside a theme in WordPress
PHP
26
star
15

authenticator

This plugin allows you to make your WordPress site accessible to logged in users only.
PHP
24
star
16

Aptana-Solarized

Aptana theme for Solarized
22
star
17

addquicktag

This plugin makes it easy to add Quicktags to the html - and visual-editor.
PHP
17
star
18

Limit-Upload

Limit the number of uploads on WordPress posts
PHP
15
star
19

Notes

Simple PHP Notes online
CSS
15
star
20

php-Console-for-WordPress

This example plugin for WordPress works with the PHP Console, is a extension for Lagger and class PhpConsole, that displays PHP errors/debug messages in Google Chrome console and in notification popups.
PHP
14
star
21

Markdown-for-MantisBT

It's help convert some Markdown to html-style.
PHP
14
star
22

marksimple

A simple Markdown parser in PHP
PHP
13
star
23

different-type

Add different types to posts of WordPress Edit area
PHP
13
star
24

Simple-Media-Queries-Debugging

Media Queries are going to establish, the pros and cons are not an issue here. "Debugging" is not easy and creating layouts can be quickly complex. This solution is an idea to know the viewport, since it shows in the upper area of the page. Via these values you can use it for different width.
PHP
12
star
25

WP-Control-Taxonomy

Small controller class to create taxonomies in WordPress with different extensions
PHP
11
star
26

PHP-Performance-Benchmarks

PHP Performance Benchmarks
HTML
8
star
27

WordPress-SAPRFC

Call ABAP functions for display content from SAP in WordPress Widgets
PHP
8
star
28

html-ipsum

<HTML> – Lorem ipsum Deutsch
Hack
8
star
29

customizer-sandbox

My sandbox to demonstrate the Customizer as default for customizing in front end.
PHP
7
star
30

local-open-sans

Use an local version of the font Open Sans in WordPress
CSS
6
star
31

Simple-Media-Queries-Tester

A simple tester for media queries, works with html5 and local storage for the sizes of the different frames
CSS
6
star
32

wordpress-basis-theme-Child-Starter

Child Theme starter kit for WP Basis
PHP
4
star
33

bueltge.github.io

Simple page to read easy about all repos and gists on Github
JavaScript
4
star
34

custom-css

A simple, solid way to add custom CSS to your WordPress website.
JavaScript
4
star
35

Drafts-Feed

WordPress Plugin, that add a new Feed for drafts and a dashbaord widget to list all drafts from all authors.
PHP
4
star
36

Set-shortcode-for-iPhone-video-tag

WordPress Plugin to Convert video-html-tag into shortcode for WordPress API and convert this for Frontend with a player
PHP
3
star
37

hCard-vCard-Generator

Microformat hCard kreieren leicht gemacht
JavaScript
3
star
38

Archive

An WordPress plugin for archive your post types, also with cron.
PHP
3
star
39

colorized-theme

My personal colorized theme.
3
star
40

Smooth-Minibar

It is a variation of a toolbar for the WordPress HTML-Editor that exposes context-related functionality.
PHP
3
star
41

Chosen-for-MantisBT

Chosen for MantisBT add the jQuery plugin Chosen that makes long, unwieldy select boxes much more user-friendly.
JavaScript
3
star
42

climatestrike

A WordPress plugin to temporarily disable the website for the Global Climate Strike on 20 September 2019.
HTML
2
star
43

simple-masonry-wordpress-theme

Simple WordPress theme to display photos ads grip with the help of the css and html.
PHP
2
star
44

php-project-template

This is my template for new PHP projects.
PHP
1
star
45

Scripts

Collection of my scripts.
Shell
1
star
46

rss-import

A WordPress Plugin that display feeds on your blog, using PHP in your templates or Shortcode in your posts and pages.
PHP
1
star