From d93b275c3a5bbbbaf74690c1894d54da64fb3467 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 2 Dec 2024 23:34:02 +0000 Subject: [PATCH] Customize: Begin HTML markup before Customizer script hooks. This prevents printing styles and scripts before the ``. 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. git-svn-id: https://develop.svn.wordpress.org/trunk@59480 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/customize.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php index 40857031a7ef8..b27292d9eb949 100644 --- a/src/wp-admin/customize.php +++ b/src/wp-admin/customize.php @@ -100,6 +100,12 @@ $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 @@ */ 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() ) :