Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::get_template()public staticWC 1.0

Returns the template matching the slug

Method of the class: BlockTemplateUtils{}

No Hooks.

Return

AbstractTemplate|AbstractTemplatePart|null.

Usage

$result = BlockTemplateUtils::get_template( $template_slug );
$template_slug(string) (required)
Slug of the template to retrieve.

BlockTemplateUtils::get_template() code WC 9.0.1

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