WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
функция не описана

Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::gutenberg_build_template_result_from_file() public WC 1.0

Build a unified template object based on a theme file.

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

Хуков нет.

Возвращает

\WP_Block_Template. Template.

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

$result = BlockTemplateUtils::gutenberg_build_template_result_from_file( $template_file, $template_type );
$template_file(массив) (обязательный)
Theme file.
$template_type(массив) (обязательный)
wp_template or wp_template_part.

Код BlockTemplateUtils::gutenberg_build_template_result_from_file() WC 6.1.0

public static function gutenberg_build_template_result_from_file( $template_file, $template_type ) {
	$template_file = (object) $template_file;

	// If the theme has an archive-products.html template but does not have product taxonomy templates
	// then we will load in the archive-product.html template from the theme to use for product taxonomies on the frontend.
	$template_is_from_theme = 'theme' === $template_file->source;
	$theme_name             = wp_get_theme()->get( 'TextDomain' );

	// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
	$template_content  = file_get_contents( $template_file->path );
	$template          = new \WP_Block_Template();
	$template->id      = $template_is_from_theme ? $theme_name . '//' . $template_file->slug : 'woocommerce//' . $template_file->slug;
	$template->theme   = $template_is_from_theme ? $theme_name : 'WooCommerce';
	$template->content = self::gutenberg_inject_theme_attribute_in_content( $template_content );
	// Plugin was agreed as a valid source value despite existing inline docs at the time of creating: https://github.com/WordPress/gutenberg/issues/36597#issuecomment-976232909.
	$template->source         = $template_file->source ? $template_file->source : 'plugin';
	$template->slug           = $template_file->slug;
	$template->type           = $template_type;
	$template->title          = ! empty( $template_file->title ) ? $template_file->title : self::convert_slug_to_title( $template_file->slug );
	$template->status         = 'publish';
	$template->has_theme_file = true;
	$template->origin         = $template_file->source;
	$template->is_custom      = false; // Templates loaded from the filesystem aren't custom, ones that have been edited and loaded from the DB are.
	$template->post_types     = array(); // Don't appear in any Edit Post template selector dropdown.
	if ( 'wp_template_part' === $template_type ) {
		if ( 'mini-cart' === $template_file->slug ) {
			$template->area = 'mini-cart';
		} else {
			$template->area = 'uncategorized';
		}
	}
	return $template;
}