-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Pullquote: Add Block Bindings support #70975
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
base: trunk
Are you sure you want to change the base?
Conversation
Size Change: +127 B (+0.01%) Total Size: 1.95 MB
ℹ️ View Unchanged
|
1ad635e
to
7c30dd0
Compare
7c30dd0
to
b2f9c62
Compare
Example pattern that has Pattern Overrides enabled and the Pullqote block with a custom source connected with one of the attributes: <!-- wp:heading {"metadata":{"name":"Headline","bindings":{"__default":{"source":"core/pattern-overrides"}}}} -->
<h2 class="wp-block-heading">Just do it!</h2>
<!-- /wp:heading -->
<!-- wp:image {"sizeSlug":"large","linkDestination":"none","metadata":{"name":"Featured image","bindings":{"__default":{"source":"core/pattern-overrides"}}}} -->
<figure class="wp-block-image size-large"><img alt=""/><figcaption class="wp-element-caption"></figcaption></figure>
<!-- /wp:image -->
<!-- wp:pullquote {"metadata":{"name":"Testimonial","bindings":{"citation":{"source":"testing/complete-source","args":{"key":"text_field"}}}}} -->
<figure class="wp-block-pullquote"><blockquote><p>This is great!</p><cite></cite></blockquote></figure>
<!-- /wp:pullquote --> This is the issue I'm seeing during testing: Screen.Recording.2025-09-19.at.15.31.57.movIt's an edge case. In the pattern that has Pattern Overrides enabled, when I try to edit the Pullquote block that doesn't enable overrides, but defines the bindings for the |
Flaky tests detected in 76105c8. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17909268829
|
Possibly due to the logic in RichText that disables editing:
|
4822edb
to
b27d92f
Compare
'core/heading': [ 'content' ], | ||
'core/button': [ 'text', 'url', 'linkTarget', 'rel' ], | ||
'core/image': [ 'id', 'url', 'title', 'alt' ], | ||
'core/image': [ 'id', 'url', 'title', 'alt', 'caption' ], |
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.
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.
I can't think of a reason, as long as the blocks/attributes work correctly for users should be fine to support them.
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.
@ockham, perhaps we should eliminate this list in a follow-up and replicate the same check as on the server with some filtering capabilities when consuming
BLOCK_BINDINGS_ALLOWED_BLOCKS
?
Yeah, right now, the list is duplicated in way too many places.
I think my preferred option would be to make the server-side list the source of truth (since it already supports filtering), and communicate it to the client. I just haven't decided yet how to do that; I couldn't think of an existing REST API endpoint to add it to, and introducing a dedicated one seemed overblown.
Maybe I'll just add it to $editor_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.
Drafted a Core PR: WordPress/wordpress-develop#9992.
Will continue work on that (and a GB counterpart) later today.
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. |
It's quite tricky, because in that case, it seems to be taking the |
#71813 should fix it. |
What?
Depends on#71483.Part of #67520.
Changes necessary in WordPress core: WordPress/wordpress-develop#9990.
Adds Block Bindings support for the Pullquote block, covering two attributes
value
andcitation
connected with RichText Fields.Known issues
When editing Pattern Overrides and the Pullquote block defines one of the attributes as connected to a custom source, the interface for other attributes doesn't get locked. Tracked in:
Why?
To add Block Bindings support in more core blocks, similar to recent addition to Post Date block, and
caption
support in the Image block.How?
Mainly enable processing of Block Bindings in the related allow lists for blocks and their attributes. Both attributes are handled with
RichText
so this should integrate seamlessly. Although an edge was discovered when using with Pattern Overrides which is tracked seperately.Testing Instructions
npx wp-env start
.value
andcitation
with some listed sources.Screenshots or screencast