locate_block_template


locate_block_template ( $template, $type, $templates )

Parameters:
  • (string) template Path to the template. See locate_template().
  • (string) type Sanitized filename without extension.
  • (string[]) templates A list of template candidates, in descending order of priority.
Returns:
  • (string) The path to the Site Editor template canvas file, or the fallback PHP template.
Defined at:
Change Log:
  • 6: .

Description

Finds a block template with equal or higher specificity than a given PHP template file.Internally, this communicates the block content that needs to be used by the template canvas through a global variable.

Related Functions

locate_template, get_block_template, get_block_templates, resolve_block_template, wp_enable_block_templates

Top Google Results

User discussions

wpseek mobile