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 |
|---|---|
| 932 | * @since 6.5.0 |
| 933 | * |
| 934 | * @param array|null $parsed_hooked_block The parsed block array for the given hooked block type, or null to suppress the block. |
| 935 | * @param string $hooked_block_type The hooked block type name. |
| 936 | * @param string $relative_position The relative position of the hooked block. |
| 937 | * @param array $parsed_anchor_block The anchor block, in parsed block array format. |
| 938 | * @param WP_Block_Template|WP_Post|array $context The block template, template part, `wp_navigation` post type, |
| 939 | * or pattern that the anchor block belongs to. |
| 940 | */ |
| 941 | $parsed_hooked_block = apply_filters( 'hooked_block', $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 942 | |
| 943 | /** |
| 944 | * Filters the parsed block array for a given hooked block. |
| 945 | * |
| 946 | * The dynamic portion of the hook name, `$hooked_block_type`, refers to the block type name of the specific hooked block. |
| 947 | * |
| 948 | * @since 6.5.0 |
| 949 | * |
| 950 | * @param array|null $parsed_hooked_block The parsed block array for the given hooked block type, or null to suppress the block. |
| Line | Code |
| 1003 | foreach ( $hooked_block_types as $index => $hooked_block_type ) { |
| 1004 | $parsed_hooked_block = array( |
| 1005 | 'blockName' => $hooked_block_type, |
| 1006 | 'attrs' => array(), |
| 1007 | 'innerBlocks' => array(), |
| 1008 | 'innerContent' => array(), |
| 1009 | ); |
| 1010 | |
| 1011 | /** This filter is documented in wp-includes/blocks.php */ |
| 1012 | $parsed_hooked_block = apply_filters( 'hooked_block', $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 1013 | |
| 1014 | /** This filter is documented in wp-includes/blocks.php */ |
| 1015 | $parsed_hooked_block = apply_filters( "hooked_block_{$hooked_block_type}", $parsed_hooked_block, $hooked_block_type, $relative_position, $parsed_anchor_block, $context ); |
| 1016 | |
| 1017 | if ( null === $parsed_hooked_block ) { |
| 1018 | unset( $hooked_block_types[ $index ] ); |
| 1019 | } |
| 1020 | } |
| 1021 | |