WordPress at Your Fingertips
function is not described

WooCommerce::is_request() private WC 1.0

What type of request is this?

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

No Hooks.

Return

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->is_request( $type );
$type(string) (required)
admin, ajax, cron or frontend.

Code of WooCommerce::is_request() WC 5.6.0

private function is_request( $type ) {
	switch ( $type ) {
		case 'admin':
			return is_admin();
		case 'ajax':
			return defined( 'DOING_AJAX' );
		case 'cron':
			return defined( 'DOING_CRON' );
		case 'frontend':
			return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' ) && ! $this->is_rest_api_request();
	}
}