soberwp / bundle
此包已被 弃用 且不再维护。没有推荐替代包。
WordPress 插件,通过 JSON、YAML 或 PHP 文件启用插件激活。
1.0.2-p
2018-08-21 08:33 UTC
Requires
- php: >=5.4.0
- composer/installers: ^1.5
- hassankhan/config: ^1.0
- tgmpa/tgm-plugin-activation: ^2.6.1
Requires (Dev)
This package is auto-updated.
Last update: 2021-06-24 13:02:33 UTC
README
WordPress 插件,通过 JSON、YAML 或 PHP 文件启用插件激活。
安装
Composer
推荐方法:
$ composer require soberwp/bundle $ wp plugin activate bundle
$ composer require soberwp/bundle:1.0.2-p
手动
- 下载 zip 文件
- 解压到您的网站插件文件夹
- 通过 WordPress 激活
要求
- PHP >= 5.6.x
设置
默认使用 bundle.json
、bundle.yaml
或 bundle.php
。
您可以使用以下过滤器在主题的 functions.php
文件中为每个使用自定义文件:
add_filter('sober/bundle/file', function () { return get_stylesheet_directory() . '/plugin-dependencies.yaml'; });
用法
主题通常需要插件才能运行 —— bundle 利用流行的 tgmpa 类来执行插件激活提示和操作。
示例
[ { "name": "Disable Comments", "slug": "disable-comments", "required": false, "force_activation": true }, { "name": "Models", "slug": "models", "source": "https://github.com/soberwp/models/archive/master.zip", "external_url": "https://github.com/models/intervention", "required": true, "force_activation": true, "force_deactivation": false } ]
--- - name: Disable Comments slug: disable-comments required: false force_activation: true - name: Models slug: models source: https://github.com/soberwp/models/archive/master.zip external_url: https://github.com/models/intervention required: true force_activation: true force_deactivation: false
<?php return [ [ 'name' => 'Disable Comments', 'slug' => 'disable-comments', 'required' => false, 'force_activation' => true ], [ 'name' => 'Models', 'slug' => 'models', 'source' => 'https://github.com/soberwp/models/archive/master.zip', 'external_url' => 'https://github.com/models/intervention', 'required' => true, 'force_activation' => true, 'force_deactivation' => false ] ];
您可以阅读 tgmpa 文档 了解插件激活选项。
更新
Composer
- 将 composer.json 版本更改为 ^1.0.2**
- 在更新之前检查 CHANGELOG.md 了解任何破坏性更改。
$ composer update
WordPress
包含对 github-updater 的支持,以通过 WordPress 后端跟踪更新。
- 下载 github-updater
- 将 github-updater 克隆到您的网站插件文件夹
- 通过 WordPress 激活
其他
- 有关更新,请关注 @withjacoby
- 您也可以 雇佣我 进行 WordPress 或前端工作