WordPress.org

Make WordPress Core

Changeset 51031


Ignore:
Timestamp:
05/26/2021 02:24:17 PM (4 months ago)
Author:
jorgefilipecosta
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r50996 r51031  
    304304    }
    305305    if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) {
    306         $editor_settings['disableCustomColors'] = $editor_settings['__experimentalFeatures']['color']['custom'];
     306        $editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom'];
    307307        unset( $editor_settings['__experimentalFeatures']['color']['custom'] );
    308308    }
    309309    if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) {
    310         $editor_settings['disableCustomGradients'] = $editor_settings['__experimentalFeatures']['color']['customGradient'];
     310        $editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient'];
    311311        unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] );
    312312    }
     
    316316    }
    317317    if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) {
    318         $editor_settings['disableCustomFontSizes'] = $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
     318        $editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize'];
    319319        unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] );
    320320    }
Note: See TracChangeset for help on using the changeset viewer.