get_block_templates
get_block_templates ( $query = array(), $template_type = 'wp_template' )
Parameters:- (array) query { Optional. Arguments to retrieve templates. @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. }
- (string) template_type Template type. Either 'wp_template' or 'wp_template_part'.
Returns:- (WP_Block_Template[]) Array of block templates.
Defined at: - Introduced in WordPress: 5.8.0
- Deprecated in WordPress: —
Description
Retrieves a list of unified template objects based on a query.