Automattic\WooCommerce\RestApi

Server::get_rest_namespaces()protectedWC 1.0

Get API namespaces - new namespaces should be registered here.

Method of the class: Server{}

Return

Array. List of Namespaces and Main controller classes.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_rest_namespaces();

Server::get_rest_namespaces() code WC 9.4.2

protected function get_rest_namespaces() {
	/**
	 * Filter the list of REST API controllers to load.
	 *
	 * @since 4.5.0
	 * @param array $controllers List of $namespace => $controllers to load.
	 */
	return apply_filters(
		'woocommerce_rest_api_get_rest_namespaces',
		array(
			'wc/v1'        => wc_rest_should_load_namespace( 'wc/v1' ) ? $this->get_v1_controllers() : array(),
			'wc/v2'        => wc_rest_should_load_namespace( 'wc/v2' ) ? $this->get_v2_controllers() : array(),
			'wc/v3'        => wc_rest_should_load_namespace( 'wc/v3' ) ? $this->get_v3_controllers() : array(),
			'wc-telemetry' => wc_rest_should_load_namespace( 'wc-telemetry' ) ? $this->get_telemetry_controllers() : array(),
		)
	);
}