-
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 API: Add block bindings "Site data" source #57259
Block Bindings API: Add block bindings "Site data" source #57259
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/site-data.php ❔ lib/experimental/block-bindings/index.php |
Size Change: +168 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
I believe that 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 site data.
How?
register_block_bindings_source
function to register the source in the server, using theget_option
function as the callback.BlockBindingsFill
andBlockBindingsFieldsList
components to inject the Site Data fields in the editor.Testing Instructions
Repeat the testing in #57258 but using the Site Data as the source.
Remaining issues