[wp-trac] [WordPress Trac] #33704: Reduce reliance on wp_is_mobile()

WordPress Trac noreply at wordpress.org
Wed Aug 31 16:38:03 UTC 2016


#33704: Reduce reliance on wp_is_mobile()
-------------------------+-----------------------------
 Reporter:  johnbillion  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.7
Component:  General      |     Version:  3.4
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  ui, javascript
-------------------------+-----------------------------

Comment (by akibjorklund):

 [attachment:33704-focus.diff] handles autofocus-related usage of
 `wp_is_mobile()`. Turns out WordPress already has a mechanism for setting
 focus: you just add a class `wp-initial-focus` to an element. This was not
 used anywere. So I just tweaked that to only fire when `wpResponsive` is
 not active. Plus, on install.php, where common.js is not available, tested
 against the viewport width instead.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33704#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list