From 928ce10da082cece532f047090c3c5fab28a0da8 Mon Sep 17 00:00:00 2001 From: ianbelanger Date: Fri, 8 May 2020 19:36:10 +0000 Subject: [PATCH] Bundled Themes: Twenty Twenty customizer retina_logo should be hidden when no logo is set. Modifies the Customize setting `Site Identity > Retina logo` so that the option is hidden if there is no logo is set in `Site Identity > Logo`. Props truongwp. Fixes #50109. Built from https://develop.svn.wordpress.org/trunk@47776 git-svn-id: http://core.svn.wordpress.org/trunk@47552 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../assets/js/customize-controls.js | 24 +++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentytwenty/assets/js/customize-controls.js b/wp-content/themes/twentytwenty/assets/js/customize-controls.js index 26136e21e2..4397cf29c7 100644 --- a/wp-content/themes/twentytwenty/assets/js/customize-controls.js +++ b/wp-content/themes/twentytwenty/assets/js/customize-controls.js @@ -35,6 +35,17 @@ } ); } ); } ); + + // Show or hide retina_logo setting on the first load. + twentyTwentySetRetineLogoVisibility( !! wp.customize( 'custom_logo' )() ); + + // Add a listener for custom_logo changes. + wp.customize( 'custom_logo', function( value ) { + value.bind( function( to ) { + // Show or hide retina_logo setting on changing custom_logo. + twentyTwentySetRetineLogoVisibility( !! to ); + } ); + } ); } ); /** @@ -87,4 +98,17 @@ // Small hack to save the option. wp.customize( 'accent_accessible_colors' )._dirty = true; } + + /** + * Shows or hides the "retina_logo" setting based on the given value. + * + * @since Twenty Twenty 1.3 + * + * @param {boolean} visible The visible value. + * + * @return {void} + */ + function twentyTwentySetRetineLogoVisibility( visible ) { + wp.customize.control( 'retina_logo' ).container.toggle( visible ); + } }( jQuery ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index f11ed8303e..5d78f8183d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47775'; +$wp_version = '5.5-alpha-47776'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.