[wp-trac] [WordPress Trac] #38242: Support media queries in wp_enqueue_script() akin to wp_enqueue_style() to prevent loading scripts unnecessary

WordPress Trac noreply at wordpress.org
Thu Oct 6 09:17:20 UTC 2016


#38242: Support media queries in wp_enqueue_script() akin to wp_enqueue_style() to
prevent loading scripts unnecessary
---------------------------+-----------------------------
 Reporter:  BjornW         |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Script Loader  |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 I'd like to suggest wp_enqueue_script() to support the option to load
 scripts based on media queries similar to wp_enqueue_style().

 This would allow us to prevent scripts from loading unless a certain media
 query has been met.

 See also these links for a bit more background:
 http://www.quirksmode.org/blog/archives/2010/08/combining_media.html
 http://blog.logo24.com/2013/07/23/javascript-media-queries-wordpress/

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38242>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list