[wp-trac] [WordPress Trac] #63806: Bundled themes: Scripts are printed directly without using wp_print_script_tag()/wp_print_inline_script_tag()
WordPress Trac
noreply at wordpress.org
Tue Oct 7 23:32:20 UTC 2025
#63806: Bundled themes: Scripts are printed directly without using
wp_print_script_tag()/wp_print_inline_script_tag()
------------------------------+--------------------------
Reporter: westonruter | Owner: westonruter
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.9
Component: Bundled Theme | Version: 5.7
Severity: normal | Resolution: fixed
Keywords: has-patch commit | Focuses: javascript
------------------------------+--------------------------
Changes (by westonruter):
* status: accepted => closed
* resolution: => fixed
Comment:
In [changeset:"60913" 60913]:
{{{
#!CommitTicketReference repository="" revision="60913"
Bundled Themes: Use `wp_print_inline_script_tag()` when available and
include `sourceURL` for JS.
Instead of manually constructing the markup for `SCRIPT` tags, leverage
`wp_print_inline_script_tag()` when available to do the construction while
also ensuring filters may inject additional attributes on the `SCRIPT`
tags, such as `nonce` for CSP. When the function is not available (prior
to WP 5.7), fall back to the manual markup construction.
This also adds the `sourceURL` comments to the inline scripts to
facilitate debugging, per #63887.
Developed in https://github.com/WordPress/wordpress-develop/pull/9416.
Follow-up to [60909], [60899].
Props debarghyabanerjee, westonruter, hbhalodia, peterwilsoncc,
sabernhardt, poena.
See #63887, #59446.
Fixes #63806.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63806#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list