From f3b1cc24e439f15e8f584f6ad60428a6f4235918 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 22 Jun 2021 17:15:27 +0000 Subject: [PATCH] Editor: Allow `custom-units` to be an array. The changes in [50959] introduced an issue where `custom_units` was always being coerced into a boolean value. This should support `array` values. Props kraftner, youknowriad, nosolosw, jorgefilipecosta. Fixes #53472. git-svn-id: https://develop.svn.wordpress.org/trunk@51203 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/block-editor.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/wp-includes/block-editor.php b/src/wp-includes/block-editor.php index e0a40e7365..fc80ef3e1b 100644 --- a/src/wp-includes/block-editor.php +++ b/src/wp-includes/block-editor.php @@ -354,11 +354,7 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex unset( $editor_settings['__experimentalFeatures']['typography']['customLineHeight'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { - if ( ! is_array( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { - $editor_settings['enableCustomUnits'] = false; - } else { - $editor_settings['enableCustomUnits'] = count( $editor_settings['__experimentalFeatures']['spacing']['units'] ) > 0; - } + $editor_settings['enableCustomUnits'] = $editor_settings['__experimentalFeatures']['spacing']['units']; unset( $editor_settings['__experimentalFeatures']['spacing']['units'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['customPadding'] ) ) {