Introduce woocommerce_rest_api_get_rest_namespaces filter

This commit is contained in:
Mike Jolley 2019-06-11 16:15:20 +01:00
parent 013934d8b7
commit ec40302980
1 changed files with 9 additions and 7 deletions

View File

@ -57,13 +57,15 @@ class RestApi {
* @return array List of Namespaces and Main controller classes. * @return array List of Namespaces and Main controller classes.
*/ */
protected function get_rest_namespaces() { protected function get_rest_namespaces() {
return [ return apply_filters(
'woocommerce_rest_api_get_rest_namespaces',
[
'wc/v1' => 'WC_REST_Controllers_V1', 'wc/v1' => 'WC_REST_Controllers_V1',
'wc/v2' => 'WC_REST_Controllers_V2', 'wc/v2' => 'WC_REST_Controllers_V2',
'wc/v3' => 'WC_REST_Controllers_V3', 'wc/v3' => 'WC_REST_Controllers_V3',
'wc/v4' => '\WooCommerce\RestApi\Version4\Controllers', 'wc/v4' => '\WooCommerce\RestApi\Version4\Controllers',
'wc-blocks/v1' => 'WC_REST_Blocks_Controllers', ]
]; );
} }
/** /**