[wp-trac] [WordPress Trac] #16024: Conditional Comments for JS

WordPress Trac noreply at wordpress.org
Sat Jan 31 20:38:16 UTC 2015


#16024: Conditional Comments for JS
--------------------------------------------------+-----------------------
 Reporter:  filosofo                              |       Owner:  azaozz
     Type:  enhancement                           |      Status:  reopened
 Priority:  high                                  |   Milestone:  4.2
Component:  Script Loader                         |     Version:  3.1
 Severity:  normal                                |  Resolution:
 Keywords:  has-patch needs-testing dev-feedback  |     Focuses:  template
--------------------------------------------------+-----------------------

Comment (by azaozz):

 Replying to [comment:95 nacin]:
 > ...wp_script_add_data() has the potential to replace
 wp_localize_script(). Is there some kind of method signature that would be
 ideal to replace wp_localize_script() that the current signature would
 prevent? Thinking forwards compatibility here.

 This is just a convenience, any plugin can use `$wp_scripts->add_data()`
 directly. I left it in there to match `wp_style_add_data()`. As this will
 be used mostly from themes, it makes sense to have these "convenience
 functions" with similar names. Don't mind changing the name though :)

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


More information about the wp-trac mailing list