WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/22/2021 05:15:27 PM (5 months ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

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

    r51200 r51203  
    355355    }
    356356    if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
    357         if ( ! is_array( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) {
    358             $editor_settings['enableCustomUnits'] = false;
    359         } else {
    360             $editor_settings['enableCustomUnits'] = count( $editor_settings['__experimentalFeatures']['spacing']['units'] ) > 0;
    361         }
     357        $editor_settings['enableCustomUnits'] = $editor_settings['__experimentalFeatures']['spacing']['units'];
    362358        unset( $editor_settings['__experimentalFeatures']['spacing']['units'] );
    363359    }
Note: See TracChangeset for help on using the changeset viewer.