WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#53472 closed defect (bug) (fixed)

Regression: "custom-units" handled as bool, should be array.

Reported by: kraftner Owned by: desrosj
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.8
Component: Editor Keywords: has-patch commit
Focuses: Cc:

Description

In the current WP 5.8 Beta 2 you can't customize Custom Units.

This seems to have been introduced with changeset:50959 since it turns custom-units into a bool no matter what:

$editor_settings['enableCustomUnits'] = count( $editor_settings['__experimentalFeatures']['spacing']['units'] ) > 0;

https://github.com/WordPress/gutenberg/blob/9b078d20caef44ecbebb17379f02d42b36947f4c/lib/global-styles.php#L202

Change History (7)

This ticket was mentioned in PR #1403 on WordPress/wordpress-develop by kraftner.


3 months ago

  • Keywords has-patch added

#2 @kraftner
3 months ago

I made PR that seems to fix it, but I have to admit I do not fully understand the complexities of the editor settings in a theme.json world yet, so better someone double-checks this. ;)

#3 @desrosj
3 months ago

  • Milestone changed from Awaiting Review to 5.8

Thanks for this ticket, @kraftner! Moving to the milestone to investigate.

This ticket was mentioned in Slack in #core-editor by desrosj. View the logs.


3 months ago

#5 @desrosj
3 months ago

  • Keywords commit added
  • Owner set to desrosj
  • Status changed from new to assigned

Went through this with a few folks in the #core-editor room in Slack and it looks good. Thanks again!

#6 @desrosj
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 51203:

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.

Note: See TracTickets for help on using tickets.