WPDev.one
Core Function
View Source on Trac ↗

resolve_block_template()

resolve_block_template( mixed $template_type, mixed $template_hierarchy, mixed $fallback_template )

Returns the correct 'wp_template' to render for the request template type.

Parameters 3 required

Name / Type Description
$template_type
string

The current template type.

Required
$template_hierarchy
string[]

The current template hierarchy, ordered by priority.

Required
$fallback_template
string

A PHP fallback template to use if no matching block template is found.

Required

Return Value

((WP_Block_Template)
| null) template A template object, or null if none could be found.

Function Information

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