[wp-trac] [WordPress Trac] #58664: Eliminate manual construction of script tags in WP_Scripts

WordPress Trac noreply at wordpress.org
Thu Sep 14 00:12:55 UTC 2023


#58664: Eliminate manual construction of script tags in WP_Scripts
--------------------------------------+--------------------------
 Reporter:  westonruter               |       Owner:  westonruter
     Type:  defect (bug)              |      Status:  accepted
 Priority:  normal                    |   Milestone:  6.4
Component:  Script Loader             |     Version:  6.3
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  javascript
--------------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch has-unit-tests 2nd-opinion => has-patch has-unit-
               tests


Comment:

 I've reverted the ability to pass a closure to
 `wp_print_inline_script_tag()`.

 I've also reverted changes to the wp-admin.

 As I've just updated the [https://github.com/WordPress/wordpress-
 develop/pull/4773 PR] description:

 > The scope here is now limited to the frontend (including Customizer
 preview) as well as the login screen (`wp-login.php`). Admin screens are
 not included since this would increase the scope significantly.
 Additionally, the core themes have not been updated since
 `wp_print_inline_script_tag()` was introduced in WP 5.7, and the last
 theme to include any custom scripts (Twenty Twenty-One) supports WordPress
 5.3 and above. So to take advantage of the example
 [https://gist.github.com/westonruter/c8b49406391a8d86a5864fb41a523ae9
 Strict CSP plugin] with core themes, you have to use one of these themes
 which don't manually construct scripts:
 >
 > * Twenty Eleven (uses manual script tag in IE conditional comment)
 > * Twenty Twelve (uses manual script tag in IE conditional comment)
 > * Twenty Thirteen
 > * Twenty Fourteen (uses manual script tag in IE conditional comment)
 > * Twenty Sixteen
 > * Twenty Nineteen

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


More information about the wp-trac mailing list