[wp-trac] [WordPress Trac] #40276: enhancement: add a $type parameter to wp_add_inline_script()

WordPress Trac noreply at wordpress.org
Mon Mar 27 16:45:17 UTC 2017


#40276: enhancement: add a $type parameter to wp_add_inline_script()
---------------------------+-----------------------------
 Reporter:  paulschreiber  |      Owner:
     Type:  enhancement    |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:  4.7.3
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 It would be helpful to add a $type parameter to wp_add_inline_script().

 Currently, it can only output scripts of type text/javascript. If you want
 something of another type, you need to either use the script_loader_tag
 filter (which gets run for every script), or manually add the script using
 a wp_head action.

 This will require changing several functions:
 * wp_add_inline_script()
 * WP_Scripts::add_inline_script()
 * WP_Scripts::do_item()
 * WP_Dependencies::add_data()
 * _WP_Dependency::add_data()

 Along with the data structure (array) used by add_data.

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


More information about the wp-trac mailing list