WC_CLI::__constructpublicWC 1.0

Load required files and hooks to make the CLI work.

Method of the class: WC_CLI{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_CLI = new WC_CLI();
$WC_CLI->__construct();

WC_CLI::__construct() code WC 10.3.5

public function __construct() {
	$this->includes();
	$this->hooks();

	/**
	 * Adds the blueprint CLI initialization to the 'init' hook to prevent premature translation loading.
	 *
	 * The hook is required because FeaturesUtil::feature_is_enabled() loads translations during the
	 * blueprint CLI check. This hook can be removed once FeaturesUtil::feature_is_enabled() is
	 * refactored to not load translations.
	 *
	 * @see https://github.com/woocommerce/woocommerce/issues/56305
	 */
	add_action( 'init', array( $this, 'add_blueprint_cli_hook' ) );

	/**
	 * Register the WP Posts importer.
	 */
	$wp_posts_importer = wc_get_container()->get( WPPostsImporter::class );
	$wp_posts_importer->register();
}