Make WordPress Core


Ignore:
Timestamp:
07/24/2024 10:57:27 AM (16 months ago)
Author:
cbravobernal
Message:

Block Bindings: Adds sources in the editor settings to consume them in the client

Adds a new property blockBindingsSources to the editor settings to expose the block bindings sources registered in the server.

Props santosguillamot, cbravobernal, gziolo, artemiosans.
Fixes #61641.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/block-bindings/wpBlockBindingsRegistry.php

    r58176 r58798  
    312312        $expected = new WP_Block_Bindings_Source( $source_two_name, $source_two_properties );
    313313        $result   = $this->registry->get_registered( 'test/source-two' );
     314        $this->registry->unregister( 'test/source-one' );
     315        $this->registry->unregister( 'test/source-two' );
     316        $this->registry->unregister( 'test/source-three' );
    314317
    315318        $this->assertEquals(
     
    381384
    382385        $new_uses_context = $block_registry->get_registered( 'core/paragraph' )->uses_context;
     386        unregister_block_bindings_source( 'test/source-one' );
     387        unregister_block_bindings_source( 'test/source-two' );
    383388        // Checks that the resulting `uses_context` contains the values from both sources.
    384389        $this->assertContains( 'commonContext', $new_uses_context );
Note: See TracChangeset for help on using the changeset viewer.