WooCommerce::is_request()
What type of request is this?
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.
WooCommerce::is_request() WooCommerce::is request code WC 9.2.3
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(); } }