From 55d9f55564d12f6edce355c65f9b3a3d02acf1ee Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 10 Oct 2022 20:11:40 +0200 Subject: [PATCH] Only include theme.css if the theme declares support for wp-block-styles (#44640) * Update client-assets.php * Update client-assets.php * Update client-assets.php * Update lib/client-assets.php Co-authored-by: Ari Stathopoulos Co-authored-by: Ari Stathopoulos --- lib/client-assets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client-assets.php b/lib/client-assets.php index 2b4a48014832b8..5dd0f3b666649f 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -324,8 +324,8 @@ function gutenberg_register_packages_styles( $styles ) { } global $editor_styles; - if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) { - // Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken. + if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) { + // Include opinionated block styles if the theme supports block styles and no $editor_styles are declared, so the editor never appears broken. $wp_edit_blocks_dependencies[] = 'wp-block-library-theme'; }