WC_REST_Authentication::is_wc_namespace │ private │ WC 1.0

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.

Метод класса: WC_REST_Authentication{}

Хуков нет.

Возвращает

bool.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->is_wc_namespace( $route ): bool;
$route(строка) (обязательный)
Route without the REST prefix or surrounding slashes.

Код WC_REST_Authentication::is_wc_namespace() WC 11.2.2

private function is_wc_namespace( string $route ): bool {
	return str_starts_with( $route, 'wc/' ) || str_starts_with( $route, 'wc-' );
}