Conversation
|
Size Change: +94 B (0%) Total Size: 6.87 MB
ℹ️ View Unchanged
|
|
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. |
|
cc/ @ellatrix for possible inclusion in WP 7.0 Beta 3 |
talldan
left a comment
There was a problem hiding this comment.
This is working nicely, thanks for fixing!
…#76040) For PHP-only registered blocks, if an attribute is bound, have the attribute control in the block inspector reflect the bound value. Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 7acb5ec |
…WordPress#76040) For PHP-only registered blocks, if an attribute is bound, have the attribute control in the block inspector reflect the bound value. Co-authored-by: ockham <bernhard-reiter@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
|
What?
For PHP-only registered blocks, if an attribute is bound, have the attribute control in the block inspector reflect the bound value.
Why?
In #75543 (comment), it was pointed out that if an attribute was connected to a Block Bindings source, those controls didn't reflect bound attribute values. This PR fixes the issue.
How?
By essentially applying the same fix as #72096.
This is the second instance (I'm aware of) of UI controls used to display (and modify) block attribute values that didn't take Block Bindings into account. In an ideal world, we might want to absorb the relevant logic into
getBlockAttributes(). Unfortunately, Block Bindings require knowledge of a given block's block context, so it's not that straight-forward.Testing Instructions
npm run wp-env-test).localhost:8889), activate the "Gutenberg Test Block Bindings" and "Gutenberg Test Server-Side Rendered Block" plugins.titleattribute to the Post Meta source'stext_custom_fielditem.countattribute to the Post Meta source's "Integer custom field" item.spacingattribute to the Post Meta source's "Number custom field" item.showEmojisattribute to the Post Meta source's "Boolean custom field" item.Additionally:
npm run test:e2e -- test/e2e/specs/editor/plugins/server-side-rendered-block.spec.js.git revert 54e664ce69ab7af7fc0626ff7f2d44b00cc04c8c.Screenshots or screencast
Follow-up
It was mentioned in #75543 (comment) that it is currently possible to bind a block attribute whose values are constrained by an
enumto an unconstrained block bindings source. I'll follow up with a PR to fix that issue.