Automattic\WooCommerce\StoreApi

Authentication::is_request_to_store_apiprotectedWC 1.0

Check if is request to the Store API.

Method of the class: Authentication{}

No Hooks.

Returns

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->is_request_to_store_api();

Authentication::is_request_to_store_api() code WC 10.4.3

protected function is_request_to_store_api() {
	if ( empty( $GLOBALS['wp']->query_vars['rest_route'] ) ) {
		return false;
	}
	return 0 === strpos( $GLOBALS['wp']->query_vars['rest_route'], '/wc/store/' );
}