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.
Line | Code |
---|---|
1096 | * Return a non-null value to bypass the WordPress theme file discovery. |
1097 | * |
1098 | * @since 5.9.0 |
1099 | * |
1100 | * @param WP_Block_Template|null $block_template Return block template object to short-circuit the default query, |
1101 | * or null to allow WP to run its normal queries. |
1102 | * @param string $id Template unique identifier (example: theme_slug//template_slug). |
1103 | * @param string $template_type Template type: `'wp_template'` or '`wp_template_part'`. |
1104 | */ |
1105 | $block_template = apply_filters( 'pre_get_block_file_template', null, $id, $template_type ); |
1106 | if ( ! is_null( $block_template ) ) { |
1107 | return $block_template; |
1108 | } |
1109 |
|
1110 | $parts = explode( '//', $id, 2 ); |
1111 | if ( count( $parts ) < 2 ) { |
1112 | /** This filter is documented in wp-includes/block-template-utils.php */ |
1113 | return apply_filters( 'get_block_file_template', null, $id, $template_type ); |
1114 | } |