apply_filters( "hooked_block_{$hooked_block_type}", array|null $parsed_hooked_block, string $hooked_block_type, string $relative_position, array $parsed_anchor_block, WP_Block_Template|WP_Post|array $context )
- Since
- 6.5.0
Filters the parsed block array for a given hooked block.
Description
The dynamic portion of the hook name, $hooked_block_type, refers to the block type name of the specific hooked block.
Compatibility
- WordPress
- since 6.5.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
$parsed_hooked_blockarray|null- The parsed block array for the given hooked block type, or null to suppress the block.
$hooked_block_typestring- The hooked block type name.
$relative_positionstring- The relative position of the hooked block.
$parsed_anchor_blockarray- The anchor block, in parsed block array format.
$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:1066insert_hooked_blocks()wp-includes/blocks.php:1124set_ignored_hooked_blocks_metadata()
Source code
* @param string $hooked_block_type The hooked block type name. * @param string $relative_position The relative position of the hooked block. * @param array $parsed_anchor_block The anchor block, in parsed block array format. * @param WP_Block_Template|WP_Post|array $context The block template, template part, post object, * or pattern that the anchor block belongs to. */ $parsed_hooked_block = apply_filters( "hooked_block_{$hooked_block_type}", $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); if ( null === $parsed_hooked_block ) { continue; } // It's possible that the filter returned a block of a different type, so we explicitlyChangelog
Introduced in 6.5.0. Unchanged from 6.7.7 through 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.