-
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: Use post meta label from register_meta
in block bindings workflows
#65099
Merged
SantosGuillamot
merged 42 commits into
trunk
from
experiment/add-label-to-register-meta-for-bindings
Sep 18, 2024
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
12f355e
Initial commit. Add meta field to post types.
cbravobernal 9ba93b0
Add post meta
cbravobernal 364dc27
Add todos
cbravobernal d3491d6
Add fields in all postType
SantosGuillamot 19cb1f9
WIP: Add first version to link templates and entities
SantosGuillamot 1e8c3bf
Revert "WIP: Add first version to link templates and entities"
SantosGuillamot f8f18fc
Only expose public fields
SantosGuillamot 82006cf
Add subtype to meta properties
SantosGuillamot ae6037e
Render the appropriate fields depending on the postType in templates
SantosGuillamot faa713f
Use context postType when available
SantosGuillamot 8706071
Fetch the data on render, preventing one click needed
cbravobernal 7593629
Yoda conditions..
cbravobernal 6758ec1
Try: Expose registered meta fields in schema
SantosGuillamot 35127e0
Try: Create a resolver to get registered post meta
SantosGuillamot ef6c64b
Use rest namespace
cbravobernal 0330ddf
Move actions and selectors to private.
cbravobernal 53ac96d
Merge useSelect
cbravobernal c41877b
Fix duplicated
cbravobernal bf7ab98
Add object_subtype to schema
SantosGuillamot da336be
Update docs to object_subtype
cbravobernal 0734e02
Add explanatory comment
cbravobernal d76d0a4
Block Bindings: Use default values in connected custom fields in temp…
SantosGuillamot ca45424
Try removing all object subtype
cbravobernal b911680
Fix e2e
cbravobernal 44048d7
Update code
cbravobernal 17e0bd6
Fix `useSelect` warning
SantosGuillamot 1d33103
Remove old comment
SantosGuillamot e17fde7
Remove support for generic templates
SantosGuillamot 782a123
Revert changes to e2e tests
SantosGuillamot 344cbf7
Change the value returned by `getFieldsList` to include label
SantosGuillamot 4914c8f
Use label in bindings panel
SantosGuillamot 780ae67
Use label in rich text placeholders
SantosGuillamot a23dd37
Add filter to include `label`
SantosGuillamot a4436b0
Use title instead of label in schema
SantosGuillamot d5eb220
Add safety check
SantosGuillamot 0a92891
Adapt branch after rebase
SantosGuillamot 0a0ee3f
Remove extra spaces
SantosGuillamot f089676
Don't rely on key outside of post meta
SantosGuillamot 6288d34
Remove key from bindings component
SantosGuillamot efa3b5d
Read title instead of label
SantosGuillamot 23908f7
Add backport to changelog
SantosGuillamot d724026
Update translator comment
SantosGuillamot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
https://github.com/WordPress/wordpress-develop/pull/7298 | ||
|
||
* https://github.com/WordPress/gutenberg/pull/65099 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This part needs further enhancements to become more flexible. In particular:
In my opinion, every source should construct
args
argument, which for Post Meta happens to be{ key }
. For Pattern Overrides that would be{}
orundefined
, and every other source could decide what that it.In effect, I believe the object item from the
fields
should have the following shape:This way it's up to the implementor to provide all that's necessary to make it work when defining
getFieldsList
fir the source.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 plan to create an issue to discuss the whole
getFieldsList
API to ensure it feels good before making it public.I believe I shouldn't have used the
args
variable name here because it doesn't refer to the source args, but the object returned bygetFieldsList
. There are two different things:args
they want. For example, in post meta we usekey
to specify which custom field the attribute is connected to:getFieldsList
API: This is used just to get a list of ALL the bindable fields in order to show them in the UI and let the user select. In this case, I believe we only need thelabel
and thevalue
. As it is a callback, each source can decide what to show as the label and the value.I hope we can clarify it by improving the
getFieldsList
API (probably needs a new name) and that part of the code, because I agree it feels confusing right now.