Automattic\WooCommerce\Admin\API

Init::rest_api_initpublicWC 1.0

Initialize the API namespaces under WooCommerce Admin.

Метод класса: Init{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Init = new Init();
$Init->rest_api_init();

Код Init::rest_api_init() WC 11.0.0

public function rest_api_init() {
	if ( wc_rest_should_load_namespace( 'wc-admin' ) ) {
		$this->rest_api_init_wc_admin();
	}

	$rest_api_util = wc_get_container()->get( RestApiUtil::class );
	$rest_api_util->lazy_load_namespace( 'wc-analytics', array( $this, 'rest_api_init_wc_analytics' ) );

	if ( Features::is_enabled( 'launch-your-store' ) ) {
		$controller        = 'Automattic\WooCommerce\Admin\API\LaunchYourStore';
		$this->$controller = new $controller();
		$this->$controller->register_routes();
	}
}