From f1aacbbe451d39a4aee40bff329100b77d2fe2fb 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 7fb4d7ced95af..10f10acb4d5a0 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -196,12 +196,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'];