[wp-trac] [WordPress Trac] #58873: Add function to pass variables to scripts

WordPress Trac noreply at wordpress.org
Tue Aug 19 09:38:48 UTC 2025


#58873: Add function to pass variables to scripts
-----------------------------+-----------------------
 Reporter:  apedog           |       Owner:  (none)
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:
Component:  Script Loader    |     Version:  5.7
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |     Focuses:
-----------------------------+-----------------------

Comment (by jonsurrell):

 I think that's a good idea since there are benefits over the existing
 options `wp_add_inline_script()` or `wp_localize_script()`. I'm concerned
 about introducing a third pattern that may not actually get much usage. Do
 you have ideas about how we could measure interest and impact?

 It may be interesting to introduce the filter in Gutenberg and migrate
 some important scripts to use it. That could provide information about
 whether there's any impact and it's worth continuing.

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


More information about the wp-trac mailing list