-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Bindings: edit external property bound to block attribute #60296
Conversation
Size Change: +176 B (0%) Total Size: 1.75 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. |
95de315
to
67b1c73
Compare
23cb9c5
to
12b973d
Compare
12b973d
to
28e6a57
Compare
close in favor of #60724 |
Follow-up of #60276This PR introduces a synchronization mechanism that updates the external property value in response to its bound block attribute changes.
What?
This implementation utilizes the source handler's custom hook
useSource
to propagate changes between the block's bound attributes and the corresponding external properties.Why?
The ability to synchronize changes between a block attribute and an external property is required for the Block Bindings API to function correctly. This ensures that the block's UI reflects the actual data state and vice versa.
How?
Through the React Hook lifecycle, this solution detects changes in the external property or the bound block attribute and updates the other accordingly. To manage these updates:
Testing Instructions
Testing Instructions for Keyboard
core/paragraph
core/image
core/button
(008) Custom Field / Default value
, theThe Godfather image
, etc.Test editing bound block attribute values
core/post-meta
source handler adding this line here:🍿
Screen.Recording.2024-04-11.at.18.58.12.mov
Screenshots or screencast