Clanbite Since 1.3.0
clanbite_locate_block_or_plugin_template( string $theme_template, string $plugin_template, string $slug, array $hierarchy ): stringResolve the template for a Clanbite route: a theme PHP file, then the block template, then the plugin's PHP loader.
Only a real theme template may be handed to locate_block_template(). Passing the plugin's own PHP loader makes WordPress treat it as a theme template that wins over the block template, so block themes would fall back to the classic loader and blocks would render after wp_head (no import map, broken Interactivity API modules).
Parameters
$theme_template(string) RequiredResult of
locate_template()(empty when the theme has no matching PHP file).$plugin_template(string) RequiredAbsolute path of the plugin's classic PHP loader used as the last resort.
$slug(string) RequiredBlock template slug registered with
register_block_template()(id segment after//).$hierarchy(string[]) RequiredTemplate file hierarchy for the route (for example
array( 'teams-create.php', 'index.php' )).
Returns
string Template path to hand back to template_include.
Defined in inc/functions-block-templates.php
Changelog
| Version | Description |
|---|---|
| 1.3.0 | Introduced. |