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

Automattic\WooCommerce\Blocks

BlockTemplatesController::get_single_block_template() public WC 1.0

Runs on the get_block_template hook. If a template is already found and passed to this function, then return it and don't run. If a template is not passed, try to look for one that matches the ID in the database, if that's not found defer to Blocks templates files. Priority goes: DB-Theme, DB-Blocks, Filesystem-Theme, Filesystem-Blocks.

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

Хуков нет.

Возвращает

Разное|null.

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

$BlockTemplatesController = new BlockTemplatesController();
$BlockTemplatesController->get_single_block_template( $template, $id, $template_type );
$template(\WP_Block_Template) (обязательный)
The found block template.
$id(строка) (обязательный)
Template unique identifier (example: theme_slug//template_slug).
$template_type(массив) (обязательный)
wp_template or wp_template_part.

Код BlockTemplatesController::get_single_block_template() WC 6.1.1

public function get_single_block_template( $template, $id, $template_type ) {

	// The template was already found before the filter runs, just return it immediately.
	if ( null !== $template ) {
		return $template;
	}

	$template_name_parts = explode( '//', $id );
	if ( count( $template_name_parts ) < 2 ) {
		return $template;
	}
	list( , $slug ) = $template_name_parts;

	// If this blocks template doesn't exist then we should just skip the function and let Gutenberg handle it.
	if ( ! $this->block_template_is_available( $slug, $template_type ) ) {
		return $template;
	}

	$available_templates = $this->get_block_templates( array( $slug ), $template_type );
	return ( is_array( $available_templates ) && count( $available_templates ) > 0 )
		? BlockTemplateUtils::gutenberg_build_template_result_from_file( $available_templates[0], $available_templates[0]->type )
		: $template;
}