Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:23:13 PM (6 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/admin/includesPost.php

    r56559 r56587  
    919919            'ancestor'        => array( 'core/test-ancestor' ),
    920920            'selectors'       => array( 'root' => '.wp-block-test' ),
     921            'block_hooks'     => array( 'core/post-content' => 'before' ),
    921922        );
    922923
     
    938939                ),
    939940                'usesContext' => array(),
     941                'blockHooks'  => array( 'core/post-content' => 'before' ),
    940942                'selectors'   => array( 'root' => '.wp-block-test' ),
    941943                'category'    => 'common',
Note: See TracChangeset for help on using the changeset viewer.