[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
Fri Oct 7 00:51:41 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         |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------
Changes (by peterwilsoncc):

 * keywords:   => close


Comment:

 The `<script>` tag doesn't support media queries. `window.matchMedia()`
 can be used by developers to detect media queries but only inside the
 script.

 A lot of JavaScript code would need to be written to support this, I think
 it falls outside the scope of `wp_enqueue_script()`.

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


More information about the wp-trac mailing list