-
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: Add block context needed for bindings in PHP #58554
Merged
SantosGuillamot
merged 20 commits into
trunk
from
update/add-block-context-for-bindings-in-php
Feb 16, 2024
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
247194d
Modify `uses_context` for allowed blocks in PHP
SantosGuillamot 98e7757
Update post meta source to use block context
SantosGuillamot 38b539d
Remove old hook used for the editor
SantosGuillamot 4194fcd
Remove possibility of passing post id from source
SantosGuillamot 3a8acd6
Set correct post id
SantosGuillamot 0534638
Adapt post meta source
SantosGuillamot 31def4b
Adapt pattern overrides source
SantosGuillamot 6cb23c5
Remove old usesContext from block.json
SantosGuillamot 1dbf2c4
Remove old filter
SantosGuillamot 3a17b09
Add backport to `uses_context` in source registration
SantosGuillamot 4cb4dc6
Update source class to include `uses_context`
SantosGuillamot aa39f96
Use `get_block_type_uses_context` when available
SantosGuillamot d8886e8
Use `empty` function in post meta source
SantosGuillamot 8dae652
Update descriptions
SantosGuillamot 9252a37
Update $supported_blocks variable name
SantosGuillamot 058fa6e
Use `in_array` properly
SantosGuillamot a77a9ce
Update bindings registry comments
SantosGuillamot 63b790e
Update allowed_blocks variable name
SantosGuillamot e557ab3
Check allowed properties in the registry
SantosGuillamot d0c3e9e
Use only compatibility filter
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
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
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
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 is a compat layer for WP 6.5, so this class is going to be used in WP 6.3 and 6.4. In effect, this check is not needed. If I follow the flow correctly, only
register_block_type_args
filter is necessary here because in older version of WP there is noget_uses_context
method.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.
You're right. I've removed it in this commit.
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.
Maybe include a comment that it differs intentionally from WP core so it doesn't get replaced by accident.
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 didn't see this one, sorry 🙏 I can do it in a follow-up PR.