public function is( $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' ) && ! defined( 'REST_REQUEST' );
		}
	}
public function is( $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' ) && ! defined( 'REST_REQUEST' );
		}
	}
public function is ( $ 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' ) && ! defined ( 'REST_REQUEST' ) ; } }
What type of request is this?

@param  string $type admin, ajax, cron or frontend.
@return bool
What type of request is this?