diff --git a/src/wp-content/themes/twentynineteen/inc/customizer.php b/src/wp-content/themes/twentynineteen/inc/customizer.php index 052d46b6aa30e..2012b09a7f10e 100644 --- a/src/wp-content/themes/twentynineteen/inc/customizer.php +++ b/src/wp-content/themes/twentynineteen/inc/customizer.php @@ -75,6 +75,7 @@ function twentynineteen_customize_register( $wp_customize ) { $wp_customize, 'primary_color_hue', array( + 'label' => __( 'Custom Color', 'twentynineteen' ), 'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ), 'section' => 'colors', 'mode' => 'hue', diff --git a/src/wp-content/themes/twentynineteen/js/customize-controls.js b/src/wp-content/themes/twentynineteen/js/customize-controls.js index 0eff108adcfcf..7d7578a8a9c65 100644 --- a/src/wp-content/themes/twentynineteen/js/customize-controls.js +++ b/src/wp-content/themes/twentynineteen/js/customize-controls.js @@ -20,7 +20,8 @@ control.container.slideUp( 180 ); } }; - + // The control-specific label is redundant because, visually, this control is part of the Color Scheme control. + control.container.find( '.customize-control-title:first' ).addClass( 'screen-reader-text' ); visibility(); setting.bind( visibility ); }); diff --git a/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js b/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js index 8477975ee400b..f852ec174cac3 100644 --- a/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js +++ b/src/wp-content/themes/twentyseventeen/assets/js/customize-controls.js @@ -18,7 +18,8 @@ control.container.slideUp( 180 ); } }; - + // The control-specific label is redundant because, visually, this control is part of the Color Scheme control. + control.container.find( '.customize-control-title:first' ).addClass( 'screen-reader-text' ); visibility(); setting.bind( visibility ); }); diff --git a/src/wp-content/themes/twentyseventeen/inc/customizer.php b/src/wp-content/themes/twentyseventeen/inc/customizer.php index 0380c9a50beb6..516c2543838cb 100644 --- a/src/wp-content/themes/twentyseventeen/inc/customizer.php +++ b/src/wp-content/themes/twentyseventeen/inc/customizer.php @@ -73,6 +73,7 @@ function twentyseventeen_customize_register( $wp_customize ) { $wp_customize, 'colorscheme_hue', array( + 'label' => __( 'Hue', 'twentyseventeen' ), 'mode' => 'hue', 'section' => 'colors', 'priority' => 6, diff --git a/src/wp-content/themes/twentytwenty/assets/js/customize.js b/src/wp-content/themes/twentytwenty/assets/js/customize.js index 944aae95bf30f..3a6d19bee8163 100644 --- a/src/wp-content/themes/twentytwenty/assets/js/customize.js +++ b/src/wp-content/themes/twentytwenty/assets/js/customize.js @@ -22,6 +22,8 @@ } } ); } + // The control-specific label is redundant because, visually, this control is part of the Color Scheme control. + control.container.find( '.customize-control-title:first' ).addClass( 'screen-reader-text' ); } ); } ); }( jQuery, wp.customize ) ); diff --git a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php index 8a560a8d49ab4..c85a53b754d2a 100644 --- a/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php +++ b/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php @@ -185,6 +185,7 @@ public static function register( $wp_customize ) { array( 'section' => 'colors', 'settings' => 'accent_hue', + 'label' => __( 'Custom Color', 'twentytwenty' ), 'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ), 'mode' => 'hue', 'active_callback' => static function () use ( $wp_customize ) { diff --git a/src/wp-includes/customize/class-wp-customize-color-control.php b/src/wp-includes/customize/class-wp-customize-color-control.php index a164c6a965a33..e218b551fa435 100644 --- a/src/wp-includes/customize/class-wp-customize-color-control.php +++ b/src/wp-includes/customize/class-wp-customize-color-control.php @@ -92,8 +92,12 @@ public function render_content() {} */ public function content_template() { ?> - <# var defaultValue = '#RRGGBB', defaultValueAttr = '', + <# + var defaultValue = '#RRGGBB', + defaultValueAttr = '', + inputId = _.uniqueId( 'customize-color-control-input-' ), isHueSlider = data.mode === 'hue'; + if ( data.defaultValue && _.isString( data.defaultValue ) && ! isHueSlider ) { if ( '#' !== data.defaultValue.substring( 0, 1 ) ) { defaultValue = '#' + data.defaultValue; @@ -101,7 +105,8 @@ public function content_template() { defaultValue = data.defaultValue; } defaultValueAttr = ' data-default-color=' + defaultValue; // Quotes added automatically. - } #> + } + #> <# if ( data.label ) { #> {{{ data.label }}} <# } #> @@ -109,13 +114,12 @@ public function content_template() { {{{ data.description }}} <# } #>
-