-
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
Block Bindings API: Add block bindings "Post data" source #57260
Block Bindings API: Add block bindings "Post data" source #57260
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/experimental/block-bindings/sources/post-data.php ❔ lib/experimental/block-bindings/index.php |
Size Change: +93 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
I believe these are the remaining issues for this part of the prototype. Although we could work on them after this PR is merged.
|
9d2c667
to
a17a2b5
Compare
11ba9d7
to
934715b
Compare
Closing this because the block bindings API implementation has changed, and it should follow a different approach. |
This pull request is built on top of #57258
What?
Using the mechanisms provided by #57249 and #57258, this pull request adds support for the "Site Data" source. It allows users to connect block attributes with the "Site Title", "Site URL", and "Site Description". We can extend this list to whatever fields we consider.
Why?
It showcases how to create new sources in the block bindings API and provides more possibilities for users allowing to connect not only to post meta but also for post data.
How?
register_block_bindings_source
function to register the source in the server, using theget_post
function as the callback.BlockBindingsFill
andBlockBindingsFieldsList
components to inject the Post Data fields in the editor.Testing Instructions
Repeat the testing in #57258 but using the Post Data as the source.
Remaining issues