Skip to content

Commit d93b275

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@59480 602fd350-edb4-49c9-b593-d223f7449a82
1 parent daad863 commit d93b275

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/wp-admin/customize.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@
100100
$wp_customize->set_autofocus( $autofocus );
101101
}
102102

103+
// Let's roll.
104+
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
105+
106+
wp_user_settings();
107+
_wp_admin_html_begin();
108+
103109
$registered = $wp_scripts->registered;
104110
$wp_scripts = new WP_Scripts();
105111
$wp_scripts->registered = $registered;
@@ -126,12 +132,6 @@
126132
*/
127133
do_action( 'customize_controls_enqueue_scripts' );
128134

129-
// Let's roll.
130-
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
131-
132-
wp_user_settings();
133-
_wp_admin_html_begin();
134-
135135
$body_class = 'wp-core-ui wp-customizer js';
136136

137137
if ( wp_is_mobile() ) :

0 commit comments

Comments
 (0)