WPDev.one
Core Function
View Source on Trac ↗

make_after_block_visitor()

make_after_block_visitor( mixed $hooked_blocks, mixed $context, mixed $callback = 'insert_hooked_blocks' )

Returns a function that injects the hooked blocks after a given block.

Parameters 3 required

Name / Type Description
$hooked_blocks
array

An array of blocks hooked to another 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 after it.

Function Information

Since Version
6.4.0
Source File
wp-includes/blocks.php
Advertisement