-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Background supports: add default controls supports #68085
Background supports: add default controls supports #68085
Conversation
…default controls. There is only "one" control officially, but at least this change allows blocks to control it pulling it in line with other blocks.
Size Change: +6 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
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 quick fix @ramonjd 🚀
Bonus points for the top-notch PR description too!
It was considered to remove the redundant __experimentalDefaultControls settings from the block.json files for Group, Post Content, Verse et. al.
However I think we could leave them in as an explicit flag if the component's default ever updates.
This makes sense to me 👍
There's also some precedent for this approach with block support flags being explicitly opted into when the support is enabled by default.
I tested this PR tweaking the group and verse configurations around in block.json and via filters. Everything worked as expected.
Default Control | Optional Control |
---|---|
LGTM 🚢
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I appreciate the speedy 👀 Thanks @aaronrobertshaw |
Part of #54336
What?
It was an oversight not to check block settings for background image default controls.
There is only "one" control officially, but at least this change allows blocks to control it pulling it in line with other blocks.
This PR passes the support settings to the component in the block style hook.
Thanks to @aaronrobertshaw for spotting it.
Why?
Blocks that support background images such as the Group block have explicitly opted into the background image default control:
But that value has not effect when, in fact, the same settings are hardcoded in the component.
The consequence is that setting the control to
false
does nothing.It was considered to remove the redundant
__experimentalDefaultControls
settings from the block.json files for Group, Post Content, Verse et. al.However I think we could leave them in as an explicit flag if the component's default ever updates.
There are still a few outstanding inconsistencies with background image supports, most of which have been noted in #54336
Testing Instructions
Insert a Group block, select it and check the styles in the block settings panel.
The background image control should be visible by default.
Now set the defaultControl to
false
:The background image control should not be visible by default.
Screenshots or screencast