bueltge/multisite-global-media
Composer 安装命令:
composer require bueltge/multisite-global-media
包简介
Multisite Global Media is a WordPress plugin which shares media across the Multisite network.
README 文档
README
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:
- Decide which blog/site will host the shared media for the network.
- Add media to the media library for the chosen blog/site.
- 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=4where the last number is the ID.
- 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.
- In
/wp-content/mu-plugins/create a new foldermgm-set-my-site-id. In /wp-content/mu-plugins/mgm-set-my-site-id/create a new filemgm-set-my-site-id.php.- 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; } );
- 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
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Other Notes
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 Frank and team members from the Syde 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.
bueltge/multisite-global-media 适用场景与选型建议
bueltge/multisite-global-media 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 32.06k 次下载、GitHub Stars 达 231, 最近一次更新时间为 2017 年 12 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 「multisite」 「muplugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bueltge/multisite-global-media 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bueltge/multisite-global-media 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bueltge/multisite-global-media 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily switch between sites on any page of your website.
A drop-in MU Plugin loader for WordPress
A drop-in MU Plugin loader for WordPress
Loads regular plugins from the plugins directory as must-use plugins, enforcing their activity while maintaining the typical update flow.
Integrates Polylang with Woocommerce
Run wp-cron on all public sites in a multisite network
统计信息
- 总下载量: 32.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 231
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2017-12-01


