Core Function
View Source on Trac ↗ make_before_block_visitor()
make_before_block_visitor( mixed $hooked_blocks, mixed $context, mixed $callback = 'insert_hooked_blocks' ) Returns a function that injects the theme attribute into, and hooked blocks before, a given block.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $hooked_blocks array | An array of blocks hooked to another given block. Required |
| mixed | (WP_Block_Template | WP_Post | array) $context A block template, template part, post object, or pattern that the blocks belong to. Required |
| callable | $callback A function that will be called for each block to generate the markup for a given list of blocks that are hooked to it. Default: 'insert_hooked_blocks'. Required |
Return Value
(callable)
callable A function that returns the serialized markup for the given block,
including the markup for any hooked blocks before it.
Function Information
Since Version
6.4.0
Source File
wp-includes/blocks.php
Advertisement