Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::get_templatepublic staticWC 1.0

Returns the template matching the slug

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

Хуков нет.

Возвращает

AbstractTemplate|AbstractTemplatePart|null.

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

$result = BlockTemplateUtils::get_template( $template_slug );
$template_slug(строка) (обязательный)
Slug of the template to retrieve.

Код BlockTemplateUtils::get_template() WC 10.3.6

public static function get_template( $template_slug ) {
	$block_templates_registry = Package::container()->get( BlockTemplatesRegistry::class );
	return $block_templates_registry->get_template( $template_slug );
}