Skip to content

Commit

Permalink
Fix a regression where custom-units are forced as an array. (#32898)
Browse files Browse the repository at this point in the history
* Fix a regression where `custom-units` are forced as an array.
  • Loading branch information
desrosj authored Jun 23, 2021
1 parent 9418b0d commit f1aacbb
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/global-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit f1aacbb

Please sign in to comment.