-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add enableCustomSpacing to block editor settings #29277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes the Spacing control not appearing when global styles are disabled and enableCustomSpacing is set to true in the post editor settings.
|
|
||
| return useMemo( | ||
| () => ( { | ||
| ...pick( settings, [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using pick here is error prone as, when one adds a new editor setting, one has to also remember to add the setting name here. I wonder if flipping this to be omit would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @noisysocks
I was getting desperate and then came across your comment.
Maybe we should document this for other contributors. Or use pick( settings, Object.keys( SETTINGS_DEFAULTS ) ).
| 'disableCustomGradients', | ||
| 'enableCustomUnits', | ||
| 'enableCustomLineHeight', | ||
| 'enableCustomSpacing', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fix.
|
Size Change: +10 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
oandregal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
|
The PR works well for me. |
|
Will this make it into WP 5.7 RC 2? I can't see the fix in the nightlies. |
Yes I'll commit it to Core shortly. |
This fixes the Spacing control not appearing when global styles are disabled and enableCustomSpacing is set to true in the post editor settings.
This fixes the Spacing control not appearing when global styles are disabled and enableCustomSpacing is set to true in the post editor settings.
Description
Fixes https://core.trac.wordpress.org/ticket/52619.
This fixes the Spacing control not appearing when global styles are disabled and
enableCustomSpacingis set totruein the post editor settings. This means that the Spacing control will appear in Core when the theme hasadd_theme_support( 'custom-spacing' );.How has this been tested?
Ensure that you are testing Gutenberg against WordPress 5.7 RC 1 or against the latest Core
trunk. This is the default Gutenberg dev environment setup.Ensure that you are using a theme with
add_theme_support( 'custom-spacing' );e.g. Twenty Twenty-one.Simulate Core and disable global styles by commenting out this line in
lib/global-styles.php:Insert a Cover block.
The Spacing panel should appear in the block inspector.