Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::get_plugin_block_template_types()public staticWC 1.0

Returns a filtered list of plugin template types, containing their localized titles and descriptions.

{} Это метод класса: BlockTemplateUtils{}

Хуков нет.

Возвращает

Массив. The plugin template types.

Использование

$result = BlockTemplateUtils::get_plugin_block_template_types();

Код BlockTemplateUtils::get_plugin_block_template_types() WC 6.9.4

public static function get_plugin_block_template_types() {
	$plugin_template_types = array(
		'single-product'                   => array(
			'title'       => _x( 'Single Product', 'Template name', 'woocommerce' ),
			'description' => __( 'Displays a single product.', 'woocommerce' ),
		),
		'archive-product'                  => array(
			'title'       => _x( 'Product Catalog', 'Template name', 'woocommerce' ),
			'description' => __( 'Displays your products.', 'woocommerce' ),
		),
		'taxonomy-product_cat'             => array(
			'title'       => _x( 'Products by Category', 'Template name', 'woocommerce' ),
			'description' => __( 'Displays products filtered by a category.', 'woocommerce' ),
		),
		'taxonomy-product_tag'             => array(
			'title'       => _x( 'Products by Tag', 'Template name', 'woocommerce' ),
			'description' => __( 'Displays products filtered by a tag.', 'woocommerce' ),
		),
		ProductSearchResultsTemplate::SLUG => array(
			'title'       => _x( 'Product Search Results', 'Template name', 'woocommerce' ),
			'description' => __( 'Displays search results for your store.', 'woocommerce' ),
		),
		MiniCartTemplate::SLUG             => array(
			'title'       => _x( 'Mini Cart', 'Template name', 'woocommerce' ),
			'description' => __( 'Template used to display the Mini Cart drawer.', 'woocommerce' ),
		),
	);

	return $plugin_template_types;
}