insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata()WP 6.6.0

Returns the markup for blocks hooked to the given anchor block in a specific relative position and then adds a list of hooked block types to an anchor block's ignored hooked block types.

This function is meant for internal use only.

Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.

No Hooks.

Return

String.

Usage

insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata( $parsed_anchor_block, $relative_position, $hooked_blocks, $context );
$parsed_anchor_block(array) (required) (passed by reference — &)
The anchor block, in parsed block array format.
$relative_position(string) (required)
The relative position of the hooked blocks. Can be one of 'before', 'after', 'first_child', or 'last_child'.
$hooked_blocks(array) (required)
An array of hooked block types, grouped by anchor block and relative position.
$context(WP_Block_Template|WP_Post|array) (required)
The block template, template part, or pattern that the anchor block belongs to.

Changelog

Since 6.6.0 Introduced.

insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata() code WP 6.6.1

function insert_hooked_blocks_and_set_ignored_hooked_blocks_metadata( &$parsed_anchor_block, $relative_position, $hooked_blocks, $context ) {
	$markup  = insert_hooked_blocks( $parsed_anchor_block, $relative_position, $hooked_blocks, $context );
	$markup .= set_ignored_hooked_blocks_metadata( $parsed_anchor_block, $relative_position, $hooked_blocks, $context );

	return $markup;
}