ubermenu_is_mobile

Knowledgebase Docs » UberMenu 3
USEFUL? 9
UberMenu 3

The ubermenu_is_mobile filter allows you to override the default mobile detection provided by wp_is_mobile. The main reason for this filter is that wp_is_mobile() considers tablets to be mobile devices, which is undesirable to some users. This filter allows you to set whatever mobile detection logic you like.

ubermenu_is_mobile

Return true when mobile, false otherwise

Example

One useful way to use this filter is to pair it with functions from another plugin, such as WP Mobile Detect

add_filter( 'ubermenu_is_mobile' , 'my_mobile_detection' , 10 , 0 );
function my_mobile_detection(){
  return wpmd_is_phone(); //WP Mobile Detect plugin function 
}