项目作者: soberwp

项目描述 :
Deprecated: WordPress plugin to enable plugin activation using a JSON, YAML or PHP file
高级语言: PHP
项目地址: git://github.com/soberwp/bundle.git
创建时间: 2017-01-07T16:02:36Z
项目社区:https://github.com/soberwp/bundle

开源协议:MIT License

下载


Bundle

WordPress plugin to enable plugin activation using a JSON, YAML or PHP file.

Installation

Composer:

Recommended method/s;

Roots Bedrock and WP-CLI

  1. $ composer require soberwp/bundle
  2. $ wp plugin activate bundle

Roots Sage

  1. $ composer require soberwp/bundle:1.0.2-p

Manual:

  • Download the zip file
  • Unzip to your sites plugin folder
  • Activate via WordPress

Requirements:

Setup

By default either bundle.json, bundle.yaml or bundle.php is used.

You can use a custom file for each using the filters below within your themes functions.php file;

  1. add_filter('sober/bundle/file', function () {
  2. return get_stylesheet_directory() . '/plugin-dependencies.yaml';
  3. });

Usage

Themes often require plugins in order to work — bundle leverages the popular tgmpa class to achieve plugin activation nags and actions.

Examples:

bundle.json

  1. [
  2. {
  3. "name": "Disable Comments",
  4. "slug": "disable-comments",
  5. "required": false,
  6. "force_activation": true
  7. },
  8. {
  9. "name": "Models",
  10. "slug": "models",
  11. "source": "https://github.com/soberwp/models/archive/master.zip",
  12. "external_url": "https://github.com/models/intervention",
  13. "required": true,
  14. "force_activation": true,
  15. "force_deactivation": false
  16. }
  17. ]

bundle.yaml

  1. ---
  2. - name: Disable Comments
  3. slug: disable-comments
  4. required: false
  5. force_activation: true
  6. - name: Models
  7. slug: models
  8. source: https://github.com/soberwp/models/archive/master.zip
  9. external_url: https://github.com/models/intervention
  10. required: true
  11. force_activation: true
  12. force_deactivation: false

bundle.php

  1. <?php
  2. return [
  3. [
  4. 'name' => 'Disable Comments',
  5. 'slug' => 'disable-comments',
  6. 'required' => false,
  7. 'force_activation' => true
  8. ],
  9. [
  10. 'name' => 'Models',
  11. 'slug' => 'models',
  12. 'source' => 'https://github.com/soberwp/models/archive/master.zip',
  13. 'external_url' => 'https://github.com/models/intervention',
  14. 'required' => true,
  15. 'force_activation' => true,
  16. 'force_deactivation' => false
  17. ]
  18. ];

You can read tgmpa documentation for plugin activation options.

Updates

Composer:

  • Change the composer.json version to ^1.0.2**
  • Check CHANGELOG.md for any breaking changes before updating.
  1. $ composer update

WordPress:

Includes support for github-updater to keep track on updates through the WordPress backend.

Other