On this page
apply_filters( 'pre_get_block_template', WP_Block_Template|null $block_template, string $id, string $template_type )
Filters the block template object before the query takes place.
Description
Return a non-null value to bypass the WordPress queries.
Parameters
$block_templateWP_Block_Template|null-
Return block template object to short-circuit the default query, or null to allow WP to run its normal queries.
$idstring-
Template unique identifier (example: theme_slug//template_slug).
$template_typestring-
Template type:
'wp_template'or 'wp_template_part'.
Source
File: wp-includes/block-template-utils.php. View all references
$block_template = apply_filters( 'pre_get_block_template', null, $id, $template_type );
Related
Used By
| Used By | Description |
|---|---|
| get_block_template() wp-includes/block-template-utils.php | Retrieves a single unified template object using its id. |
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_get_block_template