WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 960 | * @since 6.5.0 |
| 961 | * |
| 962 | * @param array|null $parsed_hooked_block The parsed block array for the given hooked block type, or null to suppress the block. |
| 963 | * @param string $hooked_block_type The hooked block type name. |
| 964 | * @param string $relative_position The relative position of the hooked block. |
| 965 | * @param array $parsed_anchor_block The anchor block, in parsed block array format. |
| 966 | * @param WP_Block_Template|WP_Post|array $context The block template, template part, post object, |
| 967 | * or pattern that the anchor block belongs to. |
| 968 | */ |
| 969 | $parsed_hooked_block = apply_filters( 'hooked_block', $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 970 | |
| 971 | /** |
| 972 | * Filters the parsed block array for a given hooked block. |
| 973 | * |
| 974 | * The dynamic portion of the hook name, `$hooked_block_type`, refers to the block type name of the specific hooked block. |
| 975 | * |
| 976 | * @since 6.5.0 |
| 977 | * |
| 978 | * @param array|null $parsed_hooked_block The parsed block array for the given hooked block type, or null to suppress the block. |
| Line | Code |
| 1031 | foreach ( $hooked_block_types as $index => $hooked_block_type ) { |
| 1032 | $parsed_hooked_block = array( |
| 1033 | 'blockName' => $hooked_block_type, |
| 1034 | 'attrs' => array(), |
| 1035 | 'innerBlocks' => array(), |
| 1036 | 'innerContent' => array(), |
| 1037 | ); |
| 1038 | |
| 1039 | /** This filter is documented in wp-includes/blocks.php */ |
| 1040 | $parsed_hooked_block = apply_filters( 'hooked_block', $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 1041 | |
| 1042 | /** This filter is documented in wp-includes/blocks.php */ |
| 1043 | $parsed_hooked_block = apply_filters( "hooked_block_{$hooked_block_type}", $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 1044 | |
| 1045 | if ( null === $parsed_hooked_block ) { |
| 1046 | unset( $hooked_block_types[ $index ] ); |
| 1047 | } |
| 1048 | } |
| 1049 | |