androlax2 / wp-plugin-control
该包的最新版本(0.1.1)没有可用的许可证信息。
WordPress插件控制库。
0.1.1
2021-01-28 19:59 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-08-29 06:07:17 UTC
README
(灵感来源于 https://github.com/PrimeTimeCode/wp-plugin-control)
WordPress插件激活控制的一个简单库。
基本用法
适用于必须使用插件内部。
强制启用插件
new \Androlax2\WordPress\PluginControl\EnablePlugins('akismet/akismet.php');
强制禁用插件
new \Androlax2\WordPress\PluginControl\DisablePlugins('akismet/akismet.php');
构造函数也可以接受插件文件数组
new \Androlax2\WordPress\PluginControl\EnablePlugins(['akismet/akismet.php', 'hello.php']);
多站
强制网络启用插件
new \Androlax2\WordPress\PluginControl\NetworkEnablePlugins('akismet/akismet.php');
强制网络禁用插件
new \Androlax2\WordPress\PluginControl\NetworkDisablePlugins('akismet/akismet.php');
注意:网络禁用插件不会阻止插件被加载,除非强制禁用,否则它可能仍然在站点级别被启用。
安装
通过Composer(推荐)
composer require androlax2/wp-plugin-control:~0.1.0