Automattic\WooCommerce\StoreApi

Authentication::is_request_to_store_api()protectedWC 1.0

Check if is request to the Store API.

Method of the class: Authentication{}

No Hooks.

Return

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 8.7.0

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/' );
}