From af8844c28767dddd211a792a1e05ca43da8ba2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=83=C2=B3=C3=85=E2=80=9Akowski?= Date: Fri, 20 May 2022 11:40:07 +0000 Subject: [PATCH] Editor: Fix opinionated block styles loading in editor Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/40937. Backport for WordPress 6.0 RC 4. Props jffng. See #55567. git-svn-id: https://develop.svn.wordpress.org/trunk@53419 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-editor.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php index c872ae84fd..11df4c9a10 100644 --- a/src/wp-includes/block-editor.php +++ b/src/wp-includes/block-editor.php @@ -309,10 +309,13 @@ function _wp_get_iframed_editor_assets() { $style_handles = array( 'wp-block-editor', 'wp-block-library', - 'wp-block-library-theme', 'wp-edit-blocks', ); + if ( current_theme_supports( 'wp-block-styles' ) ) { + $style_handles[] = 'wp-block-library-theme'; + } + if ( 'widgets.php' === $pagenow || 'customize.php' === $pagenow ) { $style_handles[] = 'wp-widgets'; $style_handles[] = 'wp-edit-widgets';