WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks

RestApi::get_routes_from_namespace() public WC 1.0

Get routes for a namespace.

{} It's a method of the class: RestApi{}

No Hooks.

Return

Array|null.

Usage

$RestApi = new RestApi();
$RestApi->get_routes_from_namespace( $namespace );
$namespace(string) (required)
Namespace to retrieve.

Code of RestApi::get_routes_from_namespace() WC 5.6.0

public function get_routes_from_namespace( $namespace ) {
	$rest_server     = rest_get_server();
	$namespace_index = $rest_server->get_namespace_index(
		[
			'namespace' => $namespace,
			'context'   => 'view',
		]
	);

	$response_data = $namespace_index->get_data();

	return isset( $response_data['routes'] ) ? $response_data['routes'] : null;
}