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
This commit is contained in:
Pascal Birchler 2024-03-28 08:26:14 +00:00
parent 1f48d214f3
commit 0503d5a240
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;
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;

View File

@ -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' ),
);
/**

View File

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

View File

@ -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.