WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks

RestApi::is_request_to_store_api() protected WC 1.0

Check if is request to the Store API.

{} It's a method of the class: RestApi{}

No Hooks.

Return

true|false.

Usage

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

Code of RestApi::is_request_to_store_api() WC 5.7.1

protected function is_request_to_store_api() {
	if ( empty( $_SERVER['REQUEST_URI'] ) ) {
		return false;
	}

	$rest_prefix = trailingslashit( rest_get_url_prefix() );
	$request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );

	return false !== strpos( $request_uri, $rest_prefix . 'wc/store' );
}