[wp-trac] [WordPress Trac] #26221: Twenty Fourteen: wp_is_mobile() shouldn't be used

WordPress Trac noreply at wordpress.org
Sun Nov 24 18:59:09 UTC 2013


#26221: Twenty Fourteen: wp_is_mobile() shouldn't be used
---------------------------+-----------------------------
 Reporter:  dimadin        |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:
 Severity:  normal         |   Keywords:
---------------------------+-----------------------------
 [26026] introduced usage of `wp_is_mobile()` function for determining size
 of thumbnail that should be displayed (see #25758).

 Since `wp_is_mobile()` checks current visitor, it should be used only on
 dynamic pages, how it was done in core before (used on admin pages only).

 Although frontend is dynamic by default, when page cache is used it isn't.
 This can for example lead to situation where page view from mobile gets to
 cache which is then served to all visitors until cache is deleted/expires.

 In this case, until browser supports for responsive images becomes
 standard, solution is to load full-width image or use some Javascript
 solution.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26221>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list