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
This commit is contained in:
Jorge Costa 2021-05-26 14:24:17 +00:00
parent d7f99f31e6
commit 6945095a3e

View File

@ -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'] ) ) {