Clanbite Since 1.3.0

clanbite_locate_block_or_plugin_template( string $theme_template, string $plugin_template, string $slug, array $hierarchy ): string

Resolve 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) Required

Result of locate_template() (empty when the theme has no matching PHP file).

$plugin_template (string) Required

Absolute path of the plugin's classic PHP loader used as the last resort.

$slug (string) Required

Block template slug registered with register_block_template() (id segment after //).

$hierarchy (string[]) Required

Template 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

VersionDescription
1.3.0Introduced.