From 5581b7172e25366778cc6189117a57a4b88898a2 Mon Sep 17 00:00:00 2001 From: Jon Desrosiers Date: Tue, 22 Jun 2021 22:21:00 -0400 Subject: [PATCH] Fix a regression where `custom-units` are forced as an array. (#32898) * Fix a regression where `custom-units` are forced as an array. --- lib/global-styles.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/global-styles.php b/lib/global-styles.php index 31b3316360ed5a..85839483187d9f 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -184,12 +184,7 @@ function_exists( 'gutenberg_is_edit_site_page' ) && unset( $settings['__experimentalFeatures']['typography']['customLineHeight'] ); } if ( isset( $settings['__experimentalFeatures']['spacing']['units'] ) ) { - if ( ! is_array( $settings['__experimentalFeatures']['spacing']['units'] ) ) { - $settings['enableCustomUnits'] = false; - } else { - $settings['enableCustomUnits'] = count( $settings['__experimentalFeatures']['spacing']['units'] ) > 0; - } - unset( $settings['__experimentalFeatures']['spacing']['units'] ); + $settings['enableCustomUnits'] = $settings['__experimentalFeatures']['spacing']['units']; } if ( isset( $settings['__experimentalFeatures']['spacing']['customPadding'] ) ) { $settings['enableCustomSpacing'] = $settings['__experimentalFeatures']['spacing']['customPadding'];