WP_CLI::do_hook() Edit

Execute callbacks registered to a given hook.


Usage Usage

WP_CLI::do_hook( $when )
$when (string) Identifier for the hook.
(mixed) Optional. Arguments that will be passed onto the
@return (null)

Top ↑

Notes Notes

See WP_CLI::add_hook() for details on WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/’s internal hook system.
Commands can provide and call their own hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same..
callback provided by WP_CLI::add_hook().

Internal APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. documentation is generated from the WP-CLI codebase on every releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software.. To suggest improvements, please submit a pull request.


Top ↑

  • WP_CLI::add_hook() – Schedule a callback to be executed at a certain point.
  • WP_CLI::add_wp_hook() – Add a callback to a WordPress action or filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output..
  • WP_CLI::add_command() – Register a command to WP-CLI.

Last updated: