diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 7630cf64e2..0f28ef4030 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -1510,12 +1510,13 @@ function wp_default_styles( $styles ) { 'wp-reset-editor-styles', 'wp-block-library', 'wp-reusable-blocks', - - // This dependency shouldn't be added for themes with theme.json support - // It's here for backward compatibility only. - // A check should be added here when theme.json is backported to Core. - 'wp-editor-classic-layout-styles', ); + + // Only load the default layout and margin styles for themes without theme.json file. + if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { + $wp_edit_blocks_dependencies[] = 'wp-editor-classic-layout-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. diff --git a/wp-includes/version.php b/wp-includes/version.php index 37ef234902..267a7fcb7d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50991'; +$wp_version = '5.8-alpha-50992'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.