You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@56587 602fd350-edb4-49c9-b593-d223f7449a82
Copy file name to clipboardExpand all lines: src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -291,6 +291,7 @@ public function prepare_item_for_response( $item, $request ) {
291
291
'editor_style_handles',
292
292
'style_handles',
293
293
'variations',
294
+
'block_hooks',
294
295
),
295
296
$deprecated_fields
296
297
);
@@ -706,6 +707,19 @@ public function get_item_schema() {
706
707
),
707
708
'keywords' => $keywords_definition,
708
709
'example' => $example_definition,
710
+
'block_hooks' => array(
711
+
'description' => __( 'This block is automatically inserted near any occurence of the block types used as keys of this map, into a relative position given by the corresponding value.' ),
0 commit comments