Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:23:13 PM (17 months ago)
Author:
Bernhard Reiter
Message:

General: Add block_hooks field to block type registration, REST API.

In order to implement Block Hooks, we need to add a new block_hooks field to the WP_Block_Type class, as well as to block registration related functions, the block types REST API controller, etc.

Props gziolo.
Fixes #59346. See #59313.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/register.php

    r56559 r56587  
    645645            'Block type should contain selectors from metadata.'
    646646        );
     647        // @ticket 59346
     648        $this->assertSame(
     649            array( 'core/post-content' => 'before' ),
     650            $result->block_hooks,
     651            'Block type should contain block hooks from metadata.'
     652        );
    647653        $this->assertSame(
    648654            array(
Note: See TracChangeset for help on using the changeset viewer.