From 60d7dcdc61ad90ddb37262970431e5da99c5ddcb Mon Sep 17 00:00:00 2001 From: jorgefilipecosta Date: Wed, 26 May 2021 14:25:59 +0000 Subject: [PATCH] Block Editor: Fix logic to enable custom colors, gradients, and font sizes. The logic to enable or disabled colors, gradients, and font sizes missed a negative operator, so when things should be enabled they weren't and they should be disabled they were enabled. This commit fixes the logic. Props ntsekouras. See #53175. Built from https://develop.svn.wordpress.org/trunk@51031 git-svn-id: http://core.svn.wordpress.org/trunk@50640 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/block-editor.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index 0fb57a280d..5a92e55d2b 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -303,11 +303,11 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex unset( $editor_settings['__experimentalFeatures']['color']['gradients'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { - $editor_settings['disableCustomColors'] = $editor_settings['__experimentalFeatures']['color']['custom']; + $editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom']; unset( $editor_settings['__experimentalFeatures']['color']['custom'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) { - $editor_settings['disableCustomGradients'] = $editor_settings['__experimentalFeatures']['color']['customGradient']; + $editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient']; unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { @@ -315,7 +315,7 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex unset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) { - $editor_settings['disableCustomFontSizes'] = $editor_settings['__experimentalFeatures']['typography']['customFontSize']; + $editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize']; unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index f1f7e92c4f..9312cba50a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-51030'; +$wp_version = '5.8-alpha-51031'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.