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.

Props ajlende, oandregal, madhudollu, swissspidy, get_dave, andrewserong, desrosj.
Fixes #60815.
Built from https://develop.svn.wordpress.org/trunk@57885


git-svn-id: http://core.svn.wordpress.org/trunk@57386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2024-03-27 16:00:12 +00:00
parent af0a8e253d
commit 0c4eec233d
4 changed files with 14 additions and 4 deletions

View File

@ -312,6 +312,17 @@ class WP_Theme_JSON_Resolver {
} }
$theme_support_data['settings']['color']['defaultGradients'] = $default_gradients; $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. // Allow themes to enable link color setting via theme_support.
if ( current_theme_supports( 'link-color' ) ) { if ( current_theme_supports( 'link-color' ) ) {
$theme_support_data['settings']['color']['link'] = true; $theme_support_data['settings']['color']['link'] = true;

View File

@ -658,7 +658,7 @@ class WP_Theme_JSON {
* @since 6.0.0 * @since 6.0.0
* @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`. * @since 6.2.0 Added `dimensions.minHeight` and `position.sticky`.
* @since 6.4.0 Added `background.backgroundImage`. * @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 * @var array
*/ */
const APPEARANCE_TOOLS_OPT_INS = array( const APPEARANCE_TOOLS_OPT_INS = array(
@ -679,7 +679,6 @@ class WP_Theme_JSON {
array( 'spacing', 'margin' ), array( 'spacing', 'margin' ),
array( 'spacing', 'padding' ), array( 'spacing', 'padding' ),
array( 'typography', 'lineHeight' ), array( 'typography', 'lineHeight' ),
array( 'shadow', 'defaultPresets' ),
); );
/** /**

View File

@ -191,7 +191,7 @@
"text": true "text": true
}, },
"shadow": { "shadow": {
"defaultPresets": false, "defaultPresets": true,
"presets": [ "presets": [
{ {
"name": "Natural", "name": "Natural",

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6-alpha-57883'; $wp_version = '6.6-alpha-57885';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.