WC_CLI::hooks()privateWC 1.0

Sets up and hooks WP CLI to our CLI code.

Method of the class: WC_CLI{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->hooks();

WC_CLI::hooks() code WC 8.7.0

private function hooks() {
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Runner::after_wp_load' );
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Tool_Command::register_commands' );
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Update_Command::register_commands' );
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_Tracker_Command::register_commands' );
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_COM_Command::register_commands' );
	WP_CLI::add_hook( 'after_wp_load', 'WC_CLI_COM_Extension_Command::register_commands' );
	$cli_runner = wc_get_container()->get( CLIRunner::class );
	WP_CLI::add_hook( 'after_wp_load', array( $cli_runner, 'register_commands' ) );
}