Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::template_is_eligible_for_product_archive_fallback()public staticWC 1.0

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() WC 8.7.0

public static function template_is_eligible_for_product_archive_fallback( $template_slug ) {
	return in_array( $template_slug, self::ELIGIBLE_FOR_ARCHIVE_PRODUCT_FALLBACK, true );
}