From 00cabf08ae0afbc6d9d94828fa5d35bd4e7eba12 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 14 Oct 2023 12:22:27 +0000 Subject: [PATCH] Twenty Nineteen: Correctly display default color names in the color palette. Instead of displaying the color names, two of the default colors displayed the color code, which was only intended to show when the user has enabled the custom color option in the Customizer. The reason is that the default value for the option is `false`, and this value is changed to the string `'custom'` if the color option is enabled, and the string `'default'` if the custom color is enabled and then reset to default colors. This commit adjusts the logic for displaying the color name, to make sure that the string value `'default'` is not compared with `false`, by adding the default value as a parameter to `get_theme_mod( 'primary_color' )`. Follow-up to [45964]. Props poena, mukesh27, ugyensupport, shailu25, anveshika, harshgajipara, nicolefurlan, syamraj24, balub, vivekawsm. Fixes #59566. Built from https://develop.svn.wordpress.org/trunk@56935 git-svn-id: http://core.svn.wordpress.org/trunk@56446 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentynineteen/functions.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentynineteen/functions.php b/wp-content/themes/twentynineteen/functions.php index 33ce770581..de93b40f77 100644 --- a/wp-content/themes/twentynineteen/functions.php +++ b/wp-content/themes/twentynineteen/functions.php @@ -139,12 +139,12 @@ if ( ! function_exists( 'twentynineteen_setup' ) ) : 'editor-color-palette', array( array( - 'name' => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Blue', 'twentynineteen' ) : null, + 'name' => 'default' === get_theme_mod( 'primary_color', 'default' ) ? __( 'Blue', 'twentynineteen' ) : null, 'slug' => 'primary', 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ), ), array( - 'name' => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Dark Blue', 'twentynineteen' ) : null, + 'name' => 'default' === get_theme_mod( 'primary_color', 'default' ) ? __( 'Dark Blue', 'twentynineteen' ) : null, 'slug' => 'secondary', 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ), ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 2332da8cd0..837d3c5a94 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-beta4-56934'; +$wp_version = '6.4-beta4-56935'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.