Filters the block templates array before the query takes place.
Return a non-null value to bypass the WordPress queries.
$block_templatesWP_Block_Template[]|null
$queryarray
slug__in string[]wp_id intarea string'wp_template_part_area' taxonomy value to filter by (for 'wp_template_part' template type only).post_type string$template_typestring
'wp_template' or 'wp_template_part'.$templates = apply_filters( 'pre_get_block_templates', null, $query, $template_type );
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_get_block_templates