diff --git a/lib/compat/wordpress-6.0/block-editor-settings.php b/lib/compat/wordpress-6.0/block-editor-settings.php index 2f120a0348bf47..d400939b018d23 100644 --- a/lib/compat/wordpress-6.0/block-editor-settings.php +++ b/lib/compat/wordpress-6.0/block-editor-settings.php @@ -71,6 +71,7 @@ function gutenberg_get_block_editor_settings( $settings ) { global $wp_version; $is_wp_5_8 = version_compare( $wp_version, '5.8', '>=' ) && version_compare( $wp_version, '5.9', '<' ); $is_wp_5_9 = version_compare( $wp_version, '5.9', '>=' ) && version_compare( $wp_version, '6.0', '<' ); + $is_wp_6_0 = version_compare( $wp_version, '6.0', '>=' ); // Make sure the styles array exists. // In some contexts, like the navigation editor, it doesn't. @@ -82,8 +83,9 @@ function gutenberg_get_block_editor_settings( $settings ) { $styles_without_existing_global_styles = array(); foreach ( $settings['styles'] as $style ) { if ( - ( $is_wp_5_8 && ! gutenberg_is_global_styles_in_5_8( $style ) ) || - ( $is_wp_5_9 && ! gutenberg_is_global_styles_in_5_9( $style ) ) + ( $is_wp_5_8 && ! gutenberg_is_global_styles_in_5_8( $style ) ) || // Can be removed when plugin minimum version is 5.9. + ( $is_wp_5_9 && ! gutenberg_is_global_styles_in_5_9( $style ) ) || // Can be removed when plugin minimum version is 6.0. + ( $is_wp_6_0 && ( ! isset( $style['isGlobalStyles'] ) || ! $style['isGlobalStyles'] ) ) ) { $styles_without_existing_global_styles[] = $style; }