Filter hook 'wp_is_mobile'

in WP Core File wp-includes/vars.php at line 189

View Source

wp_is_mobile

Filter Hook
Description
Filters whether the request should be treated as coming from a mobile device or not.

Hook Information

File Location wp-includes/vars.php View on GitHub
Hook Type Filter
Line Number 189

Hook Parameters

Type Name Description
bool $is_mobile Whether the request is from a mobile device or not.

Usage Examples

Basic Usage
<?php
// Hook into wp_is_mobile
add_filter('wp_is_mobile', 'my_custom_filter', 10, 1);

function my_custom_filter($is_mobile) {
    // Your custom filtering logic here
    return $is_mobile;
}

Source Code Context

wp-includes/vars.php:189 - How this hook is used in WordPress core
<?php
 184  	 *
 185  	 * @since 4.9.0
 186  	 *
 187  	 * @param bool $is_mobile Whether the request is from a mobile device or not.
 188  	 */
 189  	return apply_filters( 'wp_is_mobile', $is_mobile );
 190  }

PHP Documentation

<?php
/**
	 * Filters whether the request should be treated as coming from a mobile device or not.
	 *
	 * @since 4.9.0
	 *
	 * @param bool $is_mobile Whether the request is from a mobile device or not.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/vars.php
Related Hooks

Related hooks will be displayed here in future updates.