Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::theme_has_template()
Check if the theme has a template. So we know if to load our own in or not.
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'.
BlockTemplateUtils::theme_has_template() BlockTemplateUtils::theme has template code WC 9.4.2
public static function theme_has_template( $template_name ) { return (bool) self::get_theme_template_path( $template_name, 'wp_template' ); }