jetpack_check_mobile

The WordPress Core jetpack check mobile function.

Description

jetpack_check_mobile(); 

Usage

  1. if ( !function_exists( 'jetpack_check_mobile' ) ) { 
  2. require_once '/modules/minileven/minileven.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = jetpack_check_mobile(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/modules/minileven/minileven.php  
  1. function jetpack_check_mobile() { 
  2. if ( ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST ) || ( defined('APP_REQUEST') && APP_REQUEST ) ) 
  3. return false; 
  4. if ( !isset($_SERVER["HTTP_USER_AGENT"]) || (isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'false') ) 
  5. return false; 
  6. if ( jetpack_mobile_exclude() ) 
  7. return false; 
  8. if ( 1 == Jetpack_Options::get_option_and_ensure_autoload( 'wp_mobile_disable', '0' ) ) 
  9. return false; 
  10. if ( isset($_COOKIE['akm_mobile']) && $_COOKIE['akm_mobile'] == 'true' ) 
  11. return true; 
  12.  
  13. $is_mobile = jetpack_is_mobile(); 
  14.  
  15. /** 
  16. * Filter the Mobile check results. 
  17. * @module minileven 
  18. * @since 1.8.0 
  19. * @param bool $is_mobile Is the reader on a mobile device. 
  20. */ 
  21. return apply_filters( 'jetpack_check_mobile', $is_mobile );