wppaste
WordPress

apply_filters( 'hooked_block_types', string[] $hooked_block_types, string $relative_position, string $anchor_block_type, WP_Block_Template|WP_Post|array $context )

Since
6.4.0
Filters the list of hooked block types for a given anchor block type and relative position.

Compatibility

WordPress
since 6.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$hooked_block_typesstring[]
The list of hooked block types.
$relative_positionstring
The relative position of the hooked blocks.
Can be one of 'before', 'after', 'first_child', or 'last_child'.
$anchor_block_typestring
The anchor block type.
$contextWP_Block_Template|WP_Post|array
The block template, template part, post object, or pattern that the anchor block belongs to.

Where this hook fires · 2

  • wp-includes/blocks.php:1026insert_hooked_blocks()
  • wp-includes/blocks.php:1107set_ignored_hooked_blocks_metadata()

Source code

	 * @param string                          $relative_position  The relative position of the hooked blocks.	 *                                                            Can be one of 'before', 'after', 'first_child', or 'last_child'.	 * @param string                          $anchor_block_type  The anchor block type.	 * @param WP_Block_Template|WP_Post|array $context            The block template, template part, post object,	 *                                                            or pattern that the anchor block belongs to.	 */	$hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context ); 	$markup = '';	foreach ( $hooked_block_types as $hooked_block_type ) {		$parsed_hooked_block = array(			'blockName'    => $hooked_block_type,			'attrs'        => array(),

Changelog

Introduced in 6.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.