From 1be7c9356c4059fa87afdbc1f56742af53592197 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Thu, 18 Jan 2024 10:30:01 -0600 Subject: [PATCH] Backport WordPress/gutenberg#56661 - Add defaultFontSizes option to theme.json --- src/wp-includes/class-wp-theme-json.php | 29 +++++++++++++------------ src/wp-includes/theme.json | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index 37f4d11ce9fb4..876bd73b1eca3 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -151,7 +151,7 @@ class WP_Theme_JSON { ), array( 'path' => array( 'typography', 'fontSizes' ), - 'prevent_override' => false, + 'prevent_override' => array( 'typography', 'defaultFontSizes' ), 'use_default_names' => true, 'value_func' => 'wp_get_typography_font_size_value', 'css_vars' => '--wp--preset--font-size--$slug', @@ -410,19 +410,20 @@ class WP_Theme_JSON { 'defaultPresets' => null, ), 'typography' => array( - 'fluid' => null, - 'customFontSize' => null, - 'dropCap' => null, - 'fontFamilies' => null, - 'fontSizes' => null, - 'fontStyle' => null, - 'fontWeight' => null, - 'letterSpacing' => null, - 'lineHeight' => null, - 'textColumns' => null, - 'textDecoration' => null, - 'textTransform' => null, - 'writingMode' => null, + 'fluid' => null, + 'customFontSize' => null, + 'defaultFontSizes' => null, + 'dropCap' => null, + 'fontFamilies' => null, + 'fontSizes' => null, + 'fontStyle' => null, + 'fontWeight' => null, + 'letterSpacing' => null, + 'lineHeight' => null, + 'textColumns' => null, + 'textDecoration' => null, + 'textTransform' => null, + 'writingMode' => null, ), ); diff --git a/src/wp-includes/theme.json b/src/wp-includes/theme.json index f2690bd44dfeb..62d3ff6373d06 100644 --- a/src/wp-includes/theme.json +++ b/src/wp-includes/theme.json @@ -235,6 +235,7 @@ }, "typography": { "customFontSize": true, + "defaultFontSizes": true, "dropCap": true, "fontSizes": [ {