WC_REST_Authentication::is_wc_namespace
Whether a route is in a namespace a WooCommerce API key may authenticate.
'wc/' is WooCommerce; 'wc-' lets third party plugins use our authentication methods.
Method of the class: WC_REST_Authentication{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->is_wc_namespace( $route ): bool;
- $route(string) (required)
- Route without the REST prefix or surrounding slashes.
WC_REST_Authentication::is_wc_namespace() WC REST Authentication::is wc namespace code WC 11.1.2
private function is_wc_namespace( string $route ): bool {
return str_starts_with( $route, 'wc/' ) || str_starts_with( $route, 'wc-' );
}