-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Part of:
- Block API #41236
- Custom fields connected to Blocks #51373
- Block Bindings API iteration for 6.5 #54536
Related to:
- Pattern Overrides epic (WordPress 6.5) #53705.
- Create a system for inserting site/post metadata into generic blocks #37753.
- Inline Dynamic Content Solutions #21932.
EDIT: Connecting block attributes and custom fields, and the block bindings API tracking issues have been merged into this epic because they are highly related and it seems it is easier to follow having everything under the same discussion.
This issue is meant to keep track of and discuss how to connect block attributes with custom/meta fields and how Block Bindings API should work. It includes a list of tasks needed for this, and we will share updates about the progress here.
- Block Bindings API: Internal API to connect block attributes and different sources. Not only used for custom fields but for other projects like Partially Synced patterns.
- Custom Fields: Using the Block Bindings API, support for the "meta_fields" source to connect block attributes and custom fields.
For more context about the reasoning of the block bindings API, you can take a look at its original tracking issue.
Progress
This is a list of things to consider/questions related to the Block Bindings API that will be updated as we go along:
WordPress 6.5 release process
Click to see the list of issues addressed during 6.5 release cycle
---A couple of things that are important:
- This project depends on the Block Bindings API: link.
- We will start supporting just a few core blocks attributes that can be increased in a later phase. We can start with:
- Paragraph content.
- Heading content.
- Image URL.
- Button link and content.
Fixes/updates for Gutenberg 17.6 RC (Tuesday 30th)
- Decide the final name of the public class and methods included in this pull request.
- Migrate all the changes suggested in this wordpress-develop pull request to Gutenberg, including the naming decision. #58383
- Decide the final shape of the bindings object used in the blocks and make the necessary changes: #58337
- Backports to WordPress.
- Add more tests for the bindings, especially in the editor.
- Add validation in the
WP_Block_Bindings_Registry
class like others likeWP_Block_Type_Registry
are doing: link.
Fixes/updates for WordPress 6.5 beta 1 (February 13th)
- Review the accessibility of the editor with the accessibility team, including the suggestions made: link.
- Migrate to Gutenberg the changes made in this core pull request: link. PR: #58683
- Fix a bug with
strcasecmp
reported here. - Decide if we should add a
WP_Block_Binding_Source
class and handle validation there: link. PR: #6042 / Core changeset: 57562 - Refactoring the processing of block bindings into two steps: link. This would solve this issue with the empty images in pattern overrides. PR: #6059
- Add initial documentation. Core changeset: 57560
- Remove unused
setAttributes
. PR: #58806 - Lock editing by default when the source used in the bindings is not registered in the client and adapt pattern overrides. PR: #58787
Fixes/updates during beta phase
- Fix the way context is added as discussed here. Core / Gutenberg PR
- Remove unnecessary
queryId
in context: link. Solved as part of Core / Gutenberg PR - Create a guide about using block bindings. Discussion: 219. Guide part 1.
- Fix metadata attribute not being preserved after block transforms: link. PR: #59179
- Fix query loop not working as expected in the editor when blocks are bound. PR #59283
- Improve the accessibility of the block bindings:
- Review the
use-bindings-attributes
hook and improve its implementation. As part of that, we should address link. PR with the refactoring: #58895 - Fix insert button when pressing enter in bound blocks. #59361
- Don't show protected meta fields. PR #59326 / Core ticket #59326
- Dev note covering how extenders can use the block bindings.
- Review the current UX and make further improvements: link.
WordPress 6.6 planning
This section will be used to keep track of the issues that could potentially be addressed for WordPress 6.6.
As explained in this comment, the idea is to keep the scope limited and work on more functionalities if there is time at the end of the release cycle.
Initial plan
Keep in mind that this is not set in stone and it might change. The initial idea is to focus on these aspects:
Polish the existing code
- Add hook to check when we should lock controls when bindings exist: link.
- Use
RichText
identifier to check if we should make it non-editable: link. - Explore how to abstract the locking of controls: link.
- Remove the filter when a source is unregistered as discussed here.
And work on new aspects like:
- Add the possibility of editing the value of the meta fields directly from the bound blocks.
- Improve the UX when the editing of bound blocks is locked.
- Define and implement UX for editing custom fields directly from blocks connected.
- Add support for more core blocks based on feedback. #59607
Out of scope for 6.6
Trying to keep the scope limited for this short release, the idea is to work on these functionalities only once the previous points are finished:
- Add a UI to allow users to add bindings through the Editor.
- Create new sources: Site data, post data, taxonomy data.
- Explore the possibility of creating a filter to modify the value of the meta field returned. Ex: Change the date format with PHP.
- Explore the possibility of concatenating custom fields somehow. Ex:
site_url
+field_id
. - Explore the possibility of creating "before/after" setting until an Inline Binding functionality is implemented.
- Replace core blocks like Post Author to use variations using these bindings.
- Create opt-in mechanism and expand support for custom blocks (This depends on the HTML API supporting any HTML tag).
- Change the UI to use the upcoming DataViews: link.
- Probably using DataViews, add the possibility of creating new custom fields.