WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about pre_get_block_templates

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/block-template-utils.php apply_filters 891 /**
* Filters the block templates array before the query takes place.
*
* Return a non-null value to bypass the WordPress queries.
*
* @since 5.9.0
*
* @param WP_Block_Template[]|null $block_templates Return an array of block templates to short-circuit the default query,
* or null to allow WP to run it's normal queries.
* @param array $query {
* Optional. Arguments to retrieve templates.
*
* @type array $slug__in List of slugs to include.
* @type int $wp_id Post ID of customized template.
* @type string $post_type Post type to get the templates for.
* }
* @param string $template_type wp_template or wp_template_part.
*/

Hook Parameters

Parameter Type Name Description
WP_Block_Template[]|null $block_templates Return an array of block templates to short-circuit the default query,
array $quer y {
string $template_type wp_template or wp_template_part.