Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #58664


Ignore:
Timestamp:
07/02/2023 01:03:17 AM (15 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58664

    • Property Keywords has-patch has-unit-tests added
  • Ticket #58664 – Description

    initial v2  
    331. [https://github.com/WordPress/wordpress-develop/blob/260e97646db619c3c1bba0d400f1288b450ea701/src/wp-includes/class-wp-scripts.php#L413-L420 Main registered scripts]
    442. [https://github.com/WordPress/wordpress-develop/blob/260e97646db619c3c1bba0d400f1288b450ea701/src/wp-includes/class-wp-scripts.php#L248 Extra scripts] (i.e. from `wp_localize_script()`)
    5 3. [https://github.com/WordPress/wordpress-develop/blob/260e97646db619c3c1bba0d400f1288b450ea701/src/wp-includes/class-wp-scripts.php#L338 Translation scripts]
     53. [https://github.com/WordPress/wordpress-develop/blob/260e97646db619c3c1bba0d400f1288b450ea701/src/wp-includes/class-wp-scripts.php#L338 Translation] [https://github.com/WordPress/wordpress-develop/blob/260e97646db619c3c1bba0d400f1288b450ea701/src/wp-includes/class-wp-scripts.php#L723 scripts]
    66
    77Using the helper functions also makes the code much more readable as well as more robust by automatically escaping attribute values and allowing the `wp_script_attributes` and `wp_inline_script_attributes` filters to apply to the attributes being printed. It also ensures the non-HTML5 CDATA wrapper comments are added consistently. This would seem to be a logical follow-up to #39941 which introduced these functions but didn't make use of them in `WP_Scripts`. This will facilitate adding CSP attributes to scripts that core prints.