[wp-trac] [WordPress Trac] #24541: wp_is_mobile() includes tablets

WordPress Trac noreply at wordpress.org
Sat Jun 8 14:39:16 UTC 2013


#24541: wp_is_mobile() includes tablets
--------------------------+------------------------------
 Reporter:  Looimaster    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  2nd-opinion   |
--------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => 2nd-opinion


Comment:

 This is expected behaviour. Or rather, in core this is what it expects
 anyway.

 In core, `wp_is_mobile()` is used as a synonym for "is a touch device".
 It's used to un-hide various links that are only shown on mouseover for
 non-touch devices, by adding a 'mobile' class to the body.

 These days it would probably better to do this client-side with JavaScript
 (testing for the touch event) rather than applying the CSS class server-
 side.

 The difference between a mobile device and a non-mobile device is much
 less clear than it was in the past. Maybe `wp_is_mobile()` needs to be
 deprecated and replaced with `is_touch_device()`.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24541#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list