Actions and Filters
It is very important to note that WP Bones uses actions and filters at several points.
Actions
\{your_plugin_slug\}\_loaded
/**
* Fired when your plugin is started
*
*/
add_action('{your_plugin_slug}_loaded', function () {
// Do something
});
wpbones_console_deploy_start
/**
* Fired when the deploy command is started
*
* @param object $console Instance of WPBones Console
* @param string $path Destination path
*/
add_action('wpbones_console_deploy_start', function ($console, $path) {
// Do something
}, 10, 2);
wpbones_console_deploy_before_build_assets
/**
* Fired before building assets
*
* @param object $console Instance of WPBones Console
* @param string $path Destination path
*/
add_action('wpbones_console_deploy_before_build_assets', function ($console, $path) {
// Do something
}, 10, 2);
wpbones_console_deploy_after_build_assets
/**
* Fired after building assets
*
* @param object $console Instance of WPBones Console
* @param string $path Destination path
*/
add_action('wpbones_console_deploy_after_build_assets', function ($console, $path) {
// Do something
}, 10, 2);
wpbones_console_deploy_completed
/**
* Fires when the console deploy is completed.
*
* @param mixed $bones This bones command instance.
* @param string $path The deployed path.
*/
do_action('wpbones_console_deploy_completed', $this, $path);
Filters
wpbones_console_deploy_skip_folders
/**
* Filter the list of the folder to skip for the deploy version
*
* @param array $folders List of folders to skip
* @return array List of folders to skip
*/
add_filter('wpbones_console_deploy_skip_folders', function ($folders) {
return $folders;
});