wp_is_mobile
Filters whether the request should be treated as coming from a mobile device or not.
Использование
add_filter( 'wp_is_mobile', 'wp_kama_is_mobile_filter' ); /** * Function for `wp_is_mobile` filter-hook. * * @param bool $is_mobile Whether the request is from a mobile device or not. * * @return bool */ function wp_kama_is_mobile_filter( $is_mobile ){ // filter... return $is_mobile; }
- $is_mobile(true|false)
- Whether the request is from a mobile device or not.
Список изменений
С версии 4.9.0 | Введена. |
Где вызывается хук
wp_is_mobile
wp-includes/vars.php 184
return apply_filters( 'wp_is_mobile', $is_mobile );