mirror of
https://gh.wpcy.net/https://github.com/wp-cli/handbook.git
synced 2026-04-27 09:04:28 +08:00
- Organize files in folders according to the desired structure - Use directory iterator to loop through all files and folders (makes generation more robust)
1.3 KiB
1.3 KiB
WP_CLI::do_hook()
Execute callbacks registered to a given hook.
Usage
WP_CLI::do_hook( $when, $args )
$when (string) Identifier for the hook.
...$args (mixed) Optional. Arguments that will be passed onto the
@return (null|mixed) the first optional argument if optional
...$args (mixed) Optional. Arguments that will be passed onto the
@return (null|mixed) the first optional argument if optional
Notes
See WP_CLI::add_hook() for details on WP-CLI's internal hook system.
Commands can provide and call their own hooks.
callback provided by WP_CLI::add_hook().
arguments were passed, otherwise returns null.
Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.
Related
- 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 filter.
- WP_CLI::add_command() - Register a command to WP-CLI.