diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 4d2a0c5129aaa1..76abf3fb473a76 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -2771,16 +2771,6 @@ public function merge( $incoming ) { $prevent_override = $preset_metadata['prevent_override']; if ( is_array( $prevent_override ) ) { $prevent_override = _wp_array_get( $this->theme_json['settings'], $preset_metadata['prevent_override'] ); - - /* - * For backwards compatibility with presets converting from a hardcoded `false` - * for `prevent_override` to a path to a boolean (`defaultFontSizes`, for example), - * the 'merge' value for the new setting both overrides the preset and tells the - * UI to continue to display a merged set of the default values. - */ - if ( 'merge' === $prevent_override ) { - $prevent_override = false; - } } foreach ( static::VALID_ORIGINS as $origin ) { diff --git a/lib/class-wp-theme-json-schema-gutenberg.php b/lib/class-wp-theme-json-schema-gutenberg.php index 728dd32227798d..fcc43764264f43 100644 --- a/lib/class-wp-theme-json-schema-gutenberg.php +++ b/lib/class-wp-theme-json-schema-gutenberg.php @@ -116,7 +116,7 @@ private static function migrate_v2_to_v3( $old ) { if ( ! isset( $old['settings']['typography'] ) ) { $new['settings']['typography'] = array(); } - $new['settings']['typography']['defaultFontSizes'] = 'merge'; + $new['settings']['typography']['defaultFontSizes'] = false; // Set the new version. $new['version'] = 3; diff --git a/packages/block-editor/src/components/global-styles/typography-panel.js b/packages/block-editor/src/components/global-styles/typography-panel.js index 8ccb48c98fa90f..f0dac28335df57 100644 --- a/packages/block-editor/src/components/global-styles/typography-panel.js +++ b/packages/block-editor/src/components/global-styles/typography-panel.js @@ -22,7 +22,7 @@ import TextTransformControl from '../text-transform-control'; import TextDecorationControl from '../text-decoration-control'; import WritingModeControl from '../writing-mode-control'; import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils'; -import { setImmutably, uniqByProperty } from '../../utils/object'; +import { setImmutably } from '../../utils/object'; const MIN_TEXT_COLUMNS = 1; const MAX_TEXT_COLUMNS = 6; @@ -111,21 +111,6 @@ function useHasTextColumnsControl( settings ) { * @return {Array} The merged font sizes. */ function getMergedFontSizes( settings ) { - /* - * Backward compatibility for theme.json v2 is triggered by the 'merge' - * value added during the migration process. The old behavior that didn't - * match the other preset controls was to list the partially overridden - * default font sizes. The new behavior either shows all the default font - * sizes or none of them. - */ - if ( settings?.typography?.defaultFontSizes === 'merge' ) { - const fontSizes = settings?.typography?.fontSizes; - const mergedFontSizes = fontSizes - ? mergeOrigins( fontSizes ).toReversed() // New array because mergeOrigins result is cached. - : []; - return uniqByProperty( mergedFontSizes, 'slug' ).reverse(); // In-place reverse to save memory. - } - const fontSizes = settings?.typography?.fontSizes; const defaultFontSizesEnabled = !! settings?.typography?.defaultFontSizes; return [ diff --git a/phpunit/class-wp-theme-json-schema-test.php b/phpunit/class-wp-theme-json-schema-test.php index 19deb1acdfdddc..8274b1abe2f802 100644 --- a/phpunit/class-wp-theme-json-schema-test.php +++ b/phpunit/class-wp-theme-json-schema-test.php @@ -120,7 +120,7 @@ public function test_migrate_v1_to_latest() { 'width' => false, ), 'typography' => array( - 'defaultFontSizes' => 'merge', + 'defaultFontSizes' => false, 'fontStyle' => false, 'fontWeight' => false, 'letterSpacing' => false, @@ -293,7 +293,7 @@ public function test_migrate_v2_to_latest() { 'width' => false, ), 'typography' => array( - 'defaultFontSizes' => 'merge', + 'defaultFontSizes' => false, 'fontStyle' => false, 'fontWeight' => false, 'letterSpacing' => false,