mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55930 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1d1a2e3dec
commit
3e2121c83d
@ -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' );
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user