Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::template_is_eligible_for_product_archive_fallback()
Checks if we can fall back to the archive-product template for a given slug.
taxonomy-product_cat, taxonomy-product_tag, taxonomy-product_attribute templates can generally use the archive-product as a fallback if there are no specific overrides.
Метод класса: BlockTemplateUtils{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = BlockTemplateUtils::template_is_eligible_for_product_archive_fallback( $template_slug );
- $template_slug(строка) (обязательный)
- Slug to check for fallbacks.
Код BlockTemplateUtils::template_is_eligible_for_product_archive_fallback() BlockTemplateUtils::template is eligible for product archive fallback WC 7.5.1
public static function template_is_eligible_for_product_archive_fallback( $template_slug ) { return in_array( $template_slug, self::ELIGIBLE_FOR_ARCHIVE_PRODUCT_FALLBACK, true ); }