Skip to content

Commit

Permalink
Use get_block_bindings_source as public API
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Feb 2, 2024
1 parent 2f1b107 commit b337f01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/block-bindings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ function get_all_registered_block_bindings_sources() {
* @param string $source_name The name of the source.
* @return array|null The registered block bindings source, or `null` if it is not registered.
*/
function get_registered_block_bindings_source( string $source_name ) {
function get_block_bindings_source( string $source_name ) {
return WP_Block_Bindings_Registry::get_instance()->get_registered( $source_name );
}
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private function process_block_bindings( $block_content ) {
continue;
}

$block_binding_source = get_registered_block_bindings_source( $block_binding['source'] );
$block_binding_source = get_block_bindings_source( $block_binding['source'] );
if ( null === $block_binding_source ) {
continue;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/phpunit/tests/block-bindings/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function tear_down() {
*
* @covers ::register_block_bindings_source
* @covers ::get_all_registered_block_bindings_sources
* @covers ::get_registered_block_bindings_source
* @covers ::get_block_bindings_source
*/
public function test_get_all_registered() {
$source_one_name = 'test/source-one';
Expand All @@ -57,8 +57,8 @@ public function test_get_all_registered() {
$source_one_name => array_merge( array( 'name' => $source_one_name ), $source_one_properties ),
$source_two_name => array_merge( array( 'name' => $source_two_name ), $source_two_properties ),
$source_three_name => array_merge( array( 'name' => $source_three_name ), $source_three_properties ),
'core/post-meta' => get_registered_block_bindings_source( 'core/post-meta' ),
'core/pattern-overrides' => get_registered_block_bindings_source( 'core/pattern-overrides' ),
'core/post-meta' => get_block_bindings_source( 'core/post-meta' ),
'core/pattern-overrides' => get_block_bindings_source( 'core/pattern-overrides' ),
);

$registered = get_all_registered_block_bindings_sources();
Expand Down

0 comments on commit b337f01

Please sign in to comment.