From 0503d5a240934c6ee985dbbc6b69511262105675 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 28 Mar 2024 08:26:14 +0000 Subject: [PATCH] Editor: disable `shadow.defaultPresets` for classic themes. With this change default shadow presets are never shown for classic themes, and classic themes have no options for adding custom ones. This essentially reverts [57717] and [57827] / [57828], which had unintended consequences. Reviewed by audrasjb. Merges [57885] to the 6.5 branch. Props ajlende, oandregal, madhudollu, swissspidy, get_dave, andrewserong, desrosj. Fixes #60815. Built from https://develop.svn.wordpress.org/branches/6.5@57889 git-svn-id: http://core.svn.wordpress.org/branches/6.5@57390 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json-resolver.php | 11 +++++++++++ wp-includes/class-wp-theme-json.php | 3 +-- wp-includes/theme.json | 2 +- wp-includes/version.php | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-theme-json-resolver.php b/wp-includes/class-wp-theme-json-resolver.php index 44db8364f1..3ad5ecf0c4 100644 --- a/wp-includes/class-wp-theme-json-resolver.php +++ b/wp-includes/class-wp-theme-json-resolver.php @@ -312,6 +312,17 @@ class WP_Theme_JSON_Resolver { } $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; + if ( ! isset( $theme_support_data['settings']['shadow'] ) ) { + $theme_support_data['settings']['shadow'] = array(); + } + /* + * Shadow presets are explicitly disabled for classic themes until a + * decision is made for whether the default presets should match the + * other presets or if they should be disabled by default in classic + * themes. See https://github.com/WordPress/gutenberg/issues/59989. + */ + $theme_support_data['settings']['shadow']['defaultPresets'] = false; + // Allow themes to enable link color setting via theme_support. if ( current_theme_supports( 'link-color' ) ) { $theme_support_data['settings']['color']['link'] = true; diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 2a4303b5a3..d754da957a 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -658,7 +658,7 @@ class WP_Theme_JSON { * @since 6.0.0 * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`. * @since 6.4.0 Added `background.backgroundImage`. - * @since 6.5.0 Added `background.backgroundSize`, `dimensions.aspectRatio`, and `shadow.defaultPresets`. + * @since 6.5.0 Added `background.backgroundSize` and `dimensions.aspectRatio`. * @var array */ const APPEARANCE_TOOLS_OPT_INS = array( @@ -679,7 +679,6 @@ class WP_Theme_JSON { array( 'spacing', 'margin' ), array( 'spacing', 'padding' ), array( 'typography', 'lineHeight' ), - array( 'shadow', 'defaultPresets' ), ); /** diff --git a/wp-includes/theme.json b/wp-includes/theme.json index 3ce416d62e..d9ed47816c 100644 --- a/wp-includes/theme.json +++ b/wp-includes/theme.json @@ -191,7 +191,7 @@ "text": true }, "shadow": { - "defaultPresets": false, + "defaultPresets": true, "presets": [ { "name": "Natural", diff --git a/wp-includes/version.php b/wp-includes/version.php index 3b0ce27aff..cbd1f3075d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-RC3-57884'; +$wp_version = '6.5-RC3-57889'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.