Core Function
View Source on Trac ↗ locate_block_template()
locate_block_template( mixed $template, mixed $type, array $templates ) Finds a block template with equal or higher specificity than a given PHP template file.
Parameters 3 required
| Name / Type | Description |
|---|---|
| $template string | Path to the template. See locate_template(). Required |
| $type string | Sanitized filename without extension. Required |
| $templates string[] | A list of template candidates, in descending order of priority. Required |
Return Value
(string)
The path to the Site Editor template canvas file, or the fallback PHP template.
Function Information
Since Version
5.8.0
Source File
wp-includes/block-template.php
Advertisement