[wp-trac] [WordPress Trac] #22249: Add ability to set or remove attributes on enqueued scripts and styles.

WordPress Trac noreply at wordpress.org
Mon Nov 24 02:06:34 UTC 2014


#22249: Add ability to set or remove attributes on enqueued scripts and styles.
-------------------------------------------------+-------------------------
 Reporter:  ryanve                               |       Owner:
     Type:  feature request                      |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Script Loader                        |  Release
 Severity:  normal                               |     Version:
 Keywords:  dev-feedback has-patch reporter-     |  Resolution:
  feedback 2nd-opinion needs-testing             |     Focuses:
-------------------------------------------------+-------------------------
Changes (by jeremyfelt):

 * milestone:  Awaiting Review => Future Release


Comment:

 Big +1. All major browsers now support `async`, which would be very
 helpful. `defer` is likely less important because of `in_footer`, though
 still helpful. I'm sure there are other attributes I'm not aware of that
 could be included and result in more plugins using `wp_enqueue_scripts()`
 rather than something else.

 I like the idea of `$src` being an array. It could also make sense to turn
 the `$in_footer` parameter into an array - maybe `array( 'in_footer' =>
 false, 'attributes' => array( 'type' => 'text/javascript' ) )`. This may
 better imply the order of output. Including `text/javascript` as default
 may also be overkill - not sure.

 Related #12009

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


More information about the wp-trac mailing list