[wp-trac] [WordPress Trac] #43248: wp_localize_script() and ultimately print_extra_script() not using script_loader_tag filter

WordPress Trac noreply at wordpress.org
Tue Nov 7 00:14:24 UTC 2023


#43248: wp_localize_script() and ultimately print_extra_script() not using
script_loader_tag filter
--------------------------------------+-----------------------------
 Reporter:  csmillie                  |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Future Release
Component:  Script Loader             |     Version:  4.9.4
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  javascript
--------------------------------------+-----------------------------

Comment (by xiven):

 I found myself writing a near-identical patch to this one just a few days
 ago (though I had named the filter "extra_script_loader_tag"), and then
 when considering submitting it, I discovered your merge request.

 I would very much like to see this get merged - it would be extremely
 useful to me, and no doubt others. I'm not sure what (if anything) is
 currently blocking it though. Is there anything we can do to help?

 My use case for it relates to implementing a proper Content Security
 Policy on a WordPress site, since this patch makes it possible for a theme
 or plugin to add CSP nonces to all enqueued scripts programatically,
 including those generated by wp_localize_script().

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


More information about the wp-trac mailing list