Filter hook 'pre_get_block_templates'

in WP Core File wp-includes/block-template-utils.php at line 1044

Description

Filters the block templates array before the query takes place. Return a non-null value to bypass the WordPress queries. }

Occurrences

Filename Line Number
wp-includes/block-template-utils.php 1044

Parameters

Type Name Description
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 its normal queries.
array $query { Arguments to retrieve templates. All arguments are optional.
string $template_type Template type. Either 'wp_template' or 'wp_template_part'.

PHP Doc

/**
	 * 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 its normal queries.
	 * @param array  $query {
	 *     Arguments to retrieve templates. All arguments are optional.
	 *
	 *     @type string[] $slug__in  List of slugs to include.
	 *     @type int      $wp_id     Post ID of customized template.
	 *     @type string   $area      A 'wp_template_part_area' taxonomy value to filter by (for 'wp_template_part' template type only).
	 *     @type string   $post_type Post type to get the templates for.
	 * }
	 * @param string $template_type Template type. Either 'wp_template' or 'wp_template_part'.
	 */