WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::create_new_block_template_object() public WC 1.0

Build a new template object so that we can make Woo Blocks default templates available in the current theme should they not have any.

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

Хуков нет.

Возвращает

Объект. Block template object.

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

$result = BlockTemplateUtils::create_new_block_template_object( $template_file, $template_type, $template_slug, $template_is_from_theme );
$template_file(строка) (обязательный)
Block template file path.
$template_type(строка) (обязательный)
wp_template or wp_template_part.
$template_slug(строка) (обязательный)
Block template slug e.g. single-product.
$template_is_from_theme(true|false)
If the block template file is being loaded from the current theme instead of Woo Blocks.
По умолчанию: false

Код BlockTemplateUtils::create_new_block_template_object() WC 6.1.1

public static function create_new_block_template_object( $template_file, $template_type, $template_slug, $template_is_from_theme = false ) {
	$theme_name = wp_get_theme()->get( 'TextDomain' );

	$new_template_item = array(
		'slug'        => $template_slug,
		'id'          => $template_is_from_theme ? $theme_name . '//' . $template_slug : self::PLUGIN_SLUG . '//' . $template_slug,
		'path'        => $template_file,
		'type'        => $template_type,
		'theme'       => $template_is_from_theme ? $theme_name : self::PLUGIN_SLUG,
		// 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.
		'source'      => $template_is_from_theme ? 'theme' : 'plugin',
		'title'       => self::convert_slug_to_title( $template_slug ),
		'description' => '',
		'post_types'  => array(), // Don't appear in any Edit Post template selector dropdown.
	);

	return (object) $new_template_item;
}