Automattic\WooCommerce\Internal
RestApiControllerBase::handle_woocommerce_rest_api_get_rest_namespaces()
Handle the woocommerce_rest_api_get_rest_namespaces filter to add ourselves to the list of REST API controllers registered by WooCommerce.
Method of the class: RestApiControllerBase{}
No Hooks.
Return
Array
. The updated list of WooCommerce REST API namespaces/controllers.
Usage
// protected - for code of main (parent) or child class $result = $this->handle_woocommerce_rest_api_get_rest_namespaces( $namespaces ): array;
- $namespaces(array) (required)
- The original list of WooCommerce REST API namespaces/controllers.
RestApiControllerBase::handle_woocommerce_rest_api_get_rest_namespaces() RestApiControllerBase::handle woocommerce rest api get rest namespaces code WC 9.3.3
protected function handle_woocommerce_rest_api_get_rest_namespaces( array $namespaces ): array { $namespaces['wc/v3'][ $this->get_rest_api_namespace() ] = static::class; return $namespaces; }