From c8dc74b0bc760c8ba9cf48eeef760e3c7da18d92 Mon Sep 17 00:00:00 2001 From: isabel_brison Date: Tue, 9 Jan 2024 23:32:12 +0000 Subject: [PATCH] Editor: output palette presets when appearance tools or border are enabled. Adds color palette presets to global styles output if current theme supports either appearance tools or border. Props andrewserong, noisysocks. Fixes #60134. Built from https://develop.svn.wordpress.org/trunk@57259 git-svn-id: http://core.svn.wordpress.org/trunk@56765 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/global-styles-and-settings.php | 8 +++++++- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-includes/global-styles-and-settings.php b/wp-includes/global-styles-and-settings.php index 1258f1f4e3..032913db44 100644 --- a/wp-includes/global-styles-and-settings.php +++ b/wp-includes/global-styles-and-settings.php @@ -222,7 +222,13 @@ function wp_get_global_stylesheet( $types = array() ) { * @see wp_add_global_styles_for_blocks */ $origins = array( 'default', 'theme', 'custom' ); - if ( ! $supports_theme_json ) { + /* + * If the theme doesn't have theme.json but supports both appearance tools and color palette, + * the 'theme' origin should be included so color palette presets are also output. + */ + if ( ! $supports_theme_json && ( current_theme_supports( 'appearance-tools' ) || current_theme_supports( 'border' ) ) && current_theme_supports( 'editor-color-palette' ) ) { + $origins = array( 'default', 'theme' ); + } elseif ( ! $supports_theme_json ) { $origins = array( 'default' ); } $styles_rest = $tree->get_stylesheet( $types, $origins ); diff --git a/wp-includes/version.php b/wp-includes/version.php index aa1d7d80e4..abfa6ea23a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57258'; +$wp_version = '6.5-alpha-57259'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.