Customize: Begin HTML markup before Customizer script hooks.

This prevents printing styles and scripts before the `<!DOCTYPE>`.

The `_wp_admin_html_begin()` function should precede Customizer script hooks, in case a plugin prints markup inside a hook such as `admin_enqueue_scripts`.

Follow-up to [19995], [27907].

Props sabernhardt.
Fixes #62629.
Built from https://develop.svn.wordpress.org/trunk@59480


git-svn-id: http://core.svn.wordpress.org/trunk@58866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-12-02 23:36:18 +00:00
parent 789d1d9c2e
commit ab2697f8bf
2 changed files with 7 additions and 7 deletions

View File

@ -100,6 +100,12 @@ if ( ! empty( $autofocus ) ) {
$wp_customize->set_autofocus( $autofocus );
}
// Let's roll.
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
wp_user_settings();
_wp_admin_html_begin();
$registered = $wp_scripts->registered;
$wp_scripts = new WP_Scripts();
$wp_scripts->registered = $registered;
@ -126,12 +132,6 @@ wp_enqueue_style( 'customize-controls' );
*/
do_action( 'customize_controls_enqueue_scripts' );
// Let's roll.
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
wp_user_settings();
_wp_admin_html_begin();
$body_class = 'wp-core-ui wp-customizer js';
if ( wp_is_mobile() ) :

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59479';
$wp_version = '6.8-alpha-59480';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.