jetpack_is_mobile

Filter the value of jetpack_is_mobile.

Description

apply_filters( 'jetpack_is_mobile', (bool|string) $value, (string) $kind, (bool) $return_matched_agent ); 

Parameters (3)

0. $value (bool|string)
Boolean if current UA matches $kind or not. If $return_matched_agent is true, should return the UA string
1. $kind (string)
Category of mobile device being checked
2. $return_matched_agent (bool)
Boolean indicating if the UA should be returned

Usage

To run the hook, copy the example below.
  1. $value = apply_filters( 'jetpack_is_mobile', $value, $kind, $return_matched_agent ); 
  2.  
  3. if ( !empty( $value ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the jetpack_is_mobile callback 
  2. function filter_jetpack_is_mobile( $value, $kind, $return_matched_agent ) { 
  3. // make filter magic happen here... 
  4. return $value
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'jetpack_is_mobile', 'filter_jetpack_is_mobile', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'jetpack_is_mobile', 'filter_jetpack_is_mobile', 10, 3 ); 

Defined (1)

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

/class.jetpack-user-agent.php  
  1. $value = apply_filters( 'jetpack_is_mobile', $value, $kind, $return_matched_agent );