WordPress/wp-includes/customize
Weston Ruter e7747ce23e Script Loader: Use wp_get_script_tag() and wp_get_inline_script_tag()/wp_print_inline_script_tag() helper functions to output scripts on the frontend and login screen.
Using script tag helper functions allows plugins to employ the `wp_script_attributes` and `wp_inline_script_attributes` filters to inject the `nonce` attribute to apply Content Security Policy (e.g. Strict CSP). Use of helper functions also simplifies logic in `WP_Scripts`.

* Update `wp_get_inline_script_tag()` to wrap inline script in CDATA blocks for XHTML-compatibility when not using HTML5.
* Ensure the `type` attribute is printed first in `wp_get_inline_script_tag()` for back-compat.
* Wrap existing `<script>` tags in output buffering to retain IDE supports.
* In `wp_get_inline_script_tag()`, append the newline to `$javascript` before it is passed into the `wp_inline_script_attributes` filter so that the CSP hash can be computed properly.
* In `the_block_template_skip_link()`, opt to enqueue the inline script rather than print it.
* Add `ext-php` to `composer.json` under `suggest` as previously it was an undeclared dependency for running PHPUnit tests.
* Update tests to rely on `DOMDocument` to compare script markup, normalizing unsemantic differences.

Props westonruter, spacedmonkey, flixos90, 10upsimon, dmsnell, mukesh27, joemcgill, swissspidy, azaozz.
Fixes #58664.
See #39941.

Built from https://develop.svn.wordpress.org/trunk@56687


git-svn-id: http://core.svn.wordpress.org/trunk@56199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-25 21:05:21 +00:00
..
class-wp-customize-background-image-control.php Docs: Add missing documentation for some Customize class properties: 2022-05-18 15:24:14 +00:00
class-wp-customize-background-image-setting.php Docs: Add missing documentation for some Customize class properties: 2022-05-18 15:24:14 +00:00
class-wp-customize-background-position-control.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-customize-code-editor-control.php Docs: Consistently include an empty line between @since tag and @see, @link, or @global, per the documentation standards. 2020-06-16 21:07:14 +00:00
class-wp-customize-color-control.php Docs: Add a @see reference to WP_Customize_Control::__construct() in child class constructors. 2020-02-26 13:30:08 +00:00
class-wp-customize-cropped-image-control.php Coding Standards: Remove superfluous blank lines at the end of various classes. 2023-09-08 09:32:23 +00:00
class-wp-customize-custom-css-setting.php Code Modernization: Fix parameter name mismatch with parent in WP_Customize_Custom_CSS_Setting::validate(). 2021-09-09 15:18:55 +00:00
class-wp-customize-date-time-control.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-customize-filter-setting.php Docs: Remove @access notations from method DocBlocks in wp-includes/* classes. 2017-07-27 00:41:44 +00:00
class-wp-customize-header-image-control.php Coding Standards: Remove superfluous blank lines at the end of various functions. 2023-09-08 10:03:21 +00:00
class-wp-customize-header-image-setting.php Docs: Replace multiple single line comments with multi-line comments. 2023-07-10 23:00:22 +00:00
class-wp-customize-image-control.php Docs: Add documentation for the $type and $mime_type properties in WP_Customize_Image_Control. 2020-11-22 15:53:03 +00:00
class-wp-customize-media-control.php Docs: Replace multiple single line comments with multi-line comments. 2023-07-10 23:00:22 +00:00
class-wp-customize-nav-menu-auto-add-control.php Customize: Improve the menu creation flow. 2017-10-05 02:22:49 +00:00
class-wp-customize-nav-menu-control.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-customize-nav-menu-item-control.php Administration: Replace "Current theme" with "Active theme" in user facing strings. 2022-01-15 08:44:03 +00:00
class-wp-customize-nav-menu-item-setting.php Coding Standards: Remove superfluous blank lines at the end of various functions. 2023-09-08 10:03:21 +00:00
class-wp-customize-nav-menu-location-control.php Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-includes. 2019-07-02 23:42:58 +00:00
class-wp-customize-nav-menu-locations-control.php Help/About: Avoid extra redirections on HelpHub Links. 2023-02-23 11:06:19 +00:00
class-wp-customize-nav-menu-name-control.php Customize: Improve the menu creation flow. 2017-10-05 02:22:49 +00:00
class-wp-customize-nav-menu-section.php General: Replace older-style PHP type conversion functions with type casts. 2020-10-08 21:15:13 +00:00
class-wp-customize-nav-menu-setting.php Docs: Fix typos in some DocBlocks. 2022-01-18 20:29:06 +00:00
class-wp-customize-nav-menus-panel.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-customize-new-menu-control.php Docs: Add a @see reference to WP_Customize_Control::__construct() in child class constructors. 2020-02-26 13:30:08 +00:00
class-wp-customize-new-menu-section.php Docs: Use a consistent description for the $manager parameter in various Customizer class constructions. 2020-02-26 15:33:05 +00:00
class-wp-customize-partial.php Code Modernization: Add AllowDynamicProperties attribute to all (parent) classes. 2022-09-12 15:47:14 +00:00
class-wp-customize-selective-refresh.php Script Loader: Use wp_get_script_tag() and wp_get_inline_script_tag()/wp_print_inline_script_tag() helper functions to output scripts on the frontend and login screen. 2023-09-25 21:05:21 +00:00
class-wp-customize-sidebar-section.php Code is Poetry. 2017-11-30 23:11:00 +00:00
class-wp-customize-site-icon-control.php Customize: Escape blogname option in underscores templates. 2022-10-17 11:26:11 +00:00
class-wp-customize-theme-control.php Administration: Use wp_admin_notice() in /wp-includes/. 2023-09-14 01:25:16 +00:00
class-wp-customize-themes-panel.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-customize-themes-section.php Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards. 2023-08-24 09:08:15 +00:00
class-wp-customize-upload-control.php Docs: Add documentation for the $type, $mime_type, and $button_labels properties in WP_Customize_Upload_Control. 2020-11-22 15:51:03 +00:00
class-wp-sidebar-block-editor-control.php Adds the widgets block editor to widgets.php and customize.php 2021-05-25 08:52:58 +00:00
class-wp-widget-area-customize-control.php I18N: Mark screen reader strings as such with translator comments. 2023-02-07 17:10:21 +00:00
class-wp-widget-form-customize-control.php Bootstrap/Load: Remove duplicate leading slashes on inclusion of various files under ABSPATH. 2019-04-13 04:46:52 +00:00