mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add the Block Bindings API #5888
Closed
michalczaplinski
wants to merge
76
commits into
WordPress:trunk
from
michalczaplinski:feature/block-bindings-api
Closed
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
8720e12
Add the Block Bindings API
michalczaplinski 8891169
Add tests
artemiomorales eac5b22
Move tests to different directory
artemiomorales 39e52ed
Fix bug wherein block content was erased
artemiomorales 82e70ff
Update comment format for consistency
artemiomorales 6486471
Move process_block_bindings_function to class-wp-block
michalczaplinski 048330e
WordPress capitalization dangit
michalczaplinski 4a4b825
PHPDoc formatting
michalczaplinski 9a662e4
Add a better PHPDoc
michalczaplinski c92b6ac
Add a new unit test covering the _process_block_bindings() function
michalczaplinski abb56fb
More fixes for formatting, capitalization and PHPDocs
michalczaplinski e8b1195
Add @since to block-bindings.php
michalczaplinski cc6c2c2
Add version and since tags to class and methods
michalczaplinski 206b6b7
Add a comment on the block class
michalczaplinski dc8377a
Update assertions in WP_Block_Bindings_Test class
michalczaplinski 751a459
Update block binding registration function comment
michalczaplinski 423bb66
Change the signature of `wp_block_bindings_register_source` & WP_Bloc…
michalczaplinski d1b0d2e
Add type hints for `register_source()` & `replace_html()`
michalczaplinski 9f2274d
Add the missing array keys
michalczaplinski 02f0ea3
Apply https://github.com/WordPress/gutenberg/pull/58055/
michalczaplinski 9303e02
Make processing of bindings private to the class
artemiomorales 30f4ed7
Update class name and method names
artemiomorales 940fb82
Remove the `wp_block_bindings()` function and create a static get_ins…
michalczaplinski dbda027
Rename `register_block_bindings_source()` to `register()`
michalczaplinski 34d9dd7
Move the process_block_bindings & replace_html methods to the WP_bloc…
michalczaplinski 74bfae7
Rename WP_Block_Bindings to WP_Block_Bindings_Registry in missing places
michalczaplinski 013535e
Rename class-wp-block-bindings.php to class-wp-block-bindings-registr…
michalczaplinski 89e9833
Rename $source_args to $source_properties to align with other similar…
michalczaplinski 0c931e0
Add `is_registered()` & `get_registered()`
michalczaplinski 7b1ebe2
Register block bindings on 'init' action hook
michalczaplinski b0c300f
Merge branch 'trunk' into feature/block-bindings-api
michalczaplinski e0b3883
Fix incorrect loading of block bindings class
artemiomorales 2900bf5
Add validation to prevent sources from being registered twice
artemiomorales 26da23e
Add 'core' namespace to built-in sources
artemiomorales 29213d8
Fix incorrect reading of sources
artemiomorales 4c3d892
Rename 'apply' to 'get_value_callback'
artemiomorales 06a3930
Fix incorrect reading of registered sources
artemiomorales f53121d
Ensure unauthorized users don't read post meta
artemiomorales 5b8eb4a
Fix PHPCS errors
artemiomorales 45a96f8
Rename sources using naming pattern for block types
artemiomorales 08ddb0a
Add context to translation
artemiomorales 3a16941
Update comments and revise to use proper array annotation
artemiomorales 1729f65
Update callback comment with return type details; fix PHPCS
artemiomorales 9ea2c9a
Code quality improvements for the Block Bindings Registry
gziolo fd090ab
Ensure that code comments fit into the line length limit
gziolo 6ea69cd
Updates to the test
michalczaplinski 15dea88
Merge branch 'trunk' into feature/block-bindings-api
michalczaplinski 5893867
Remove the files already committed in #5965 and #5966.
michalczaplinski d10b165
Update block bindings function call in class-wp-block.php
michalczaplinski c324e65
Add set_up to block-bindings tests
michalczaplinski a0d550a
Refactor block bindings tests
michalczaplinski 3f242d3
Fix block bindings registration unit test and test setup
michalczaplinski d202e5d
Move tests to block-bindings directory
michalczaplinski 2a20dee
Remove unnecessary attributes from the test
michalczaplinski 2b4cf33
Incorporate PHP changes from https://github.com/WordPress/gutenberg/p…
michalczaplinski 8604e82
Fix binding source arguments in WP_Block class
michalczaplinski 65a7c09
Test passing arguments to the source
michalczaplinski 1ceef1b
Undo the changes in register.php
michalczaplinski 3d97457
Merge branch 'trunk' into feature/block-bindings-api
michalczaplinski 5f397aa
Update the docstring for `process_block_bindings`
michalczaplinski f2a611b
Update source_name parameter documentation in block-bindings.php and …
michalczaplinski a1e1bac
Refactor post_meta_source_callback function to use is_post_publicly_v…
michalczaplinski 26571a7
Remove unnecessary condition for unregistering block bindings sources
michalczaplinski d189f50
Fix access control logic in post_meta_source_callback function
michalczaplinski d7201ce
Optimize call to post_password_required()
artemiomorales 69ed754
Update pattern source label and PHPDoc string.
michalczaplinski 951ca16
Merge branch 'trunk' into feature/block-bindings-api
michalczaplinski f10a4fe
Update block bindings source labels
michalczaplinski 0bec833
Wrap the block binding registrations with 'init' actions
michalczaplinski 3134faa
Use $this->block_type directly in replace_html method
michalczaplinski 9491be3
Mark functions passed to init actions in block binding sources as pri…
michalczaplinski c95b92f
Prefix block binding function names with `_` to mark as private
michalczaplinski 3619e18
Update the function names again
michalczaplinski c8232ac
Prevent pattern and post meta sources from registering in unit tests
michalczaplinski 871cedc
Use `call_user_func_array` to call the source binding callback in WP_…
michalczaplinski 604f7a2
Validate that `$block['attrs']['metadata']['bindings']` is an array i…
michalczaplinski 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
Fix block bindings registration unit test and test setup
- Loading branch information
commit 3f242d3caf3e8b2a0439945a290e9554722b07e8
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
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.
Updated this line because the unit tests fail otherwise. That's because in this PR we're also registering
core/post-meta
andcore/pattern-attributes
sources.