WP_CLI::add_wp_hook() Edit

Add a callback to a WordPress action or filter.

Usage Usage

WP_CLI::add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 )
$tag (string) Named WordPress action or filter.
$function_to_add (mixed) Callable to execute when the action or filter is evaluated.
$priority (integer) Priority to add the callback as.
$accepted_args (integer) Number of arguments to pass to callback.
@return (true)

Top ↑

Notes Notes

add_action() without needing access to add_action(). If WordPress is
already loaded though, you should use add_action() (and add_filter())

Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.

Top ↑