*/ namespace AffiLinks; defined( 'ABSPATH' ) || exit; /** * Helper class. */ class Helper { /** * What type of request is this? * * @param string $type admin, ajax, cron or frontend. * @return bool */ public static function is_request( $type ) { switch ( $type ) { case 'admin': return is_admin(); case 'ajax': return defined( 'DOING_AJAX' ); case 'cron': return defined( 'DOING_CRON' ); } } }