From 6945095a3e039f29344ec9bd248f88918a5bc3c5 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Wed, 26 May 2021 14:24:17 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@51031 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-editor.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php index 0fb57a280d..5a92e55d2b 100644 --- a/src/wp-includes/block-editor.php +++ b/src/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'] ) ) {