Automattic\WooCommerce\Admin\API
Init::rest_api_init
Initialize the API namespaces under WooCommerce Admin.
Method of the class: Init{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Init = new Init(); $Init->rest_api_init();
Init::rest_api_init() Init::rest api init code WC 10.5.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();
}
}