Dev oriented plugin to manage theme's plugins (activation and deactivation) by forcing or suggesting it.
- Download and install using the built-in WordPress plugin installer.
- Site Activate in the "Plugins" area of the admin.
- Optionally drop the entire
bea-manage-theme-plugins
directory intomu-plugins
. - Add into your theme's functions.php file how to manage your list of plugins, see Usages.
- Add repository source :
{ "type": "vcs", "url": "https://github.com/BeAPI/bea-manage-theme-plugins" }
. - Include
"bea/bea-manage-theme-plugins": "dev-master"
in your composer file. - Add into your theme's functions.php file how to manage your list of plugins, see Usages.
In your theme's functions.php file, hook on bea\manage_theme_plugins\theme_plugins
to manage theme's plugins dependencies.
Here is an example of how theme's plugins array is formatted :
$theme_plugins = [
plugin-folder1 => $action1,
plugin-file2.php => $action1
];
Available actions are :
- force_activation
- suggest_activation
- force_deactivation
- suggest_deactivation
<?php
/**
* Manage all plugin dependencies
*/
add_filter( 'bea\manage_theme_plugins\theme_plugins', 'manage_my_theme_plugins' );
function manage_my_theme_plugins( $plugins ) {
$theme_plugins = [
'plugin-folder1' => 'force_activation',
'plugin2' => 'force_deactivation'
];
return $plugins;
}
Will exec only on given site, the theme's plugins management.
wp plugin theme_management --url={site_url}
Will exec on all sites, the theme's plugins management.
wp site list --fields=url \ | xargs -I % wp plugin theme_management --url=%
The old command "plugins manage_all" is deprecated/removed.
- Minor refactoring PHP comments (thanks @TweetPressFr)
- Rename WP-CLI command from "plugins manage_single" to "plugin theme_management" (issue #7)
- Refactoring plugin, use new plugin array structure
- Remove "manage_all" WP-Cli command
- Allow call plugin by short name, eg: advanced-custom-fields (without end part)
- Remove some plugin actions from Plugins list
- Fix multiple wp-cli call.
- Refactoring & reformatting.
- More wp-cli messages (logs / success).
- Add wp cli to single or multiple management.
- Update WP warnings messages.
- Implement main methods to register/deregister theme's plugins depending in if it's forced or suggested.
- Update readme with usage & example.
- Add plugin's .pot.
- Add French translation (po/mo).
- Add composer.json !
- Init with boilerplate 2.1.6