WPDev.one
Core Function
View Source on Trac ↗

_get_block_template_file()

_get_block_template_file( mixed $template_type, mixed $slug )

Retrieves the template file from the theme for a given slug.

Parameters 2 required

Name / Type Description
$template_type
string

Template type. Either 'wp_template' or 'wp_template_part'.

Required
$slug
string

Template slug.

Required

Return Value

((array)
(array | null) { Array with template metadata if $template_type is one of 'wp_template' or 'wp_template_part', null otherwise.

Function Information

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