WPDev.one
Core Function
View Source on Trac ↗

get_block_file_template()

get_block_file_template( mixed $id, mixed $template_type = 'wp_template' )

Retrieves a unified template object based on a theme file.

Parameters 2 required

Name / Type Description
$id
string

Template unique identifier (example: 'theme_slug//template_slug').

Required
string

$template_type Optional. Template type. Either 'wp_template' or 'wp_template_part'. Default 'wp_template'.

Required

Return Value

((WP_Block_Template)
| null) The found block template, or null if there isn't one.

Function Information

Since Version
5.9.0
Source File
wp-includes/block-template-utils.php
Advertisement