WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::theme_has_template() public WC 1.0

Check if the theme has a template. So we know if to load our own in or not.

{} It's a method of the class: BlockTemplateUtils{}

No Hooks.

Return

true|false.

Usage

$result = BlockTemplateUtils::theme_has_template( $template_name );
$template_name(string) (required)
name of the template file without .html extension e.g. 'single-product'.

Code of BlockTemplateUtils::theme_has_template() WC 6.1.0

public static function theme_has_template( $template_name ) {
	return is_readable( get_template_directory() . '/block-templates/' . $template_name . '.html' ) ||
		is_readable( get_stylesheet_directory() . '/block-templates/' . $template_name . '.html' );
}