Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::theme_has_template_part()
Check if the theme has a template. So we know if to load our own in or not.
Метод класса: BlockTemplateUtils{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = BlockTemplateUtils::theme_has_template_part( $template_name );
- $template_name(строка) (обязательный)
- name of the template file without .html extension e.g. 'single-product'.
Код BlockTemplateUtils::theme_has_template_part() BlockTemplateUtils::theme has template part WC 8.7.0
public static function theme_has_template_part( $template_name ) { return ! ! self::get_theme_template_path( $template_name, 'wp_template_part' ); }