apply_filters( ‘get_block_templates’, WP_Block_Template[] $query_result, array $query, string $template_type )

In this article

Filters the array of queried block templates array after they’ve been fetched.

Parameters

$query_resultWP_Block_Template[]
Array of found block templates.
$queryarray
Arguments to retrieve templates. All arguments are optional.
  • slug__in string[]
    List of slugs to include.
  • wp_id int
    Post ID of customized template.
  • area string
    A 'wp_template_part_area' taxonomy value to filter by (for 'wp_template_part' template type only).
  • post_type string
    Post type to get the templates for.
$template_typestring
wp_template or wp_template_part.

Source

return apply_filters( 'get_block_templates', $query_result, $query, $template_type );

Changelog

VersionDescription
5.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.