From 8b93938860e5989ddad6f3fe2ff75d9bf00f0761 Mon Sep 17 00:00:00 2001 From: spacedmonkey Date: Fri, 16 Jun 2023 13:28:21 +0000 Subject: [PATCH] Themes: Inline render blocking CSS `classic-themes.css' Since [54358], a new CSS file classic-themes.css is enqueued on all pages on the front end of themes without `theme.json`. This is a blocking http request, the impact on performance will be affected by network conditions. Inlining this style, stops this blocking request. By adding style data of path to the registered style, the function `wp_maybe_inline_styles` will automatically inline the style for us. Props spacedmonkey, adamsilverstein. Fixes #58480. Built from https://develop.svn.wordpress.org/trunk@55930 git-svn-id: http://core.svn.wordpress.org/trunk@55442 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 76155ac226..d104598d3f 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -3718,6 +3718,7 @@ function wp_enqueue_classic_theme_styles() { if ( ! wp_theme_has_theme_json() ) { $suffix = wp_scripts_get_suffix(); wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css" ); + wp_style_add_data( 'classic-theme-styles', 'path', ABSPATH . WPINC . "/css/classic-themes$suffix.css" ); wp_enqueue_style( 'classic-theme-styles' ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6c6f794abb..a79e4a2003 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55929'; +$wp_version = '6.3-alpha-55930'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.