diff --git a/lib/client-assets.php b/lib/client-assets.php index b7537057b89ab7..e048d2f57208ba 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -335,7 +335,7 @@ function gutenberg_register_packages_styles( $styles ) { } global $editor_styles; - if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) { + if ( current_theme_supports( 'wp-block-styles' ) ) { // 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'; } diff --git a/lib/compat/wordpress-6.1/template-parts-screen.php b/lib/compat/wordpress-6.1/template-parts-screen.php index 9db531b99045ee..2a18dc928eabb6 100644 --- a/lib/compat/wordpress-6.1/template-parts-screen.php +++ b/lib/compat/wordpress-6.1/template-parts-screen.php @@ -177,10 +177,7 @@ static function( $classes ) { wp_enqueue_style( 'wp-format-library' ); wp_enqueue_media(); - if ( - current_theme_supports( 'wp-block-styles' ) && - ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) - ) { + if ( current_theme_supports( 'wp-block-styles' ) ) { wp_enqueue_style( 'wp-block-library-theme' ); } diff --git a/lib/compat/wordpress-6.2/script-loader.php b/lib/compat/wordpress-6.2/script-loader.php index 39a6fcfab7e950..21c237d142a3a4 100644 --- a/lib/compat/wordpress-6.2/script-loader.php +++ b/lib/compat/wordpress-6.2/script-loader.php @@ -79,10 +79,7 @@ function gutenberg_resolve_assets_override() { 'wp-edit-blocks', ); - if ( - current_theme_supports( 'wp-block-styles' ) && - ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) - ) { + if ( current_theme_supports( 'wp-block-styles' ) ) { $style_handles[] = 'wp-block-library-theme'; }