Automattic\WooCommerce\Internal\Admin\BlockTemplates

Block::get_formatted_template()publicWC 1.0

Get the block configuration as a formatted template.

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

Хуков нет.

Возвращает

Массив. The block configuration as a formatted template.

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

$Block = new Block();
$Block->get_formatted_template(): array;

Код Block::get_formatted_template() WC 8.1.1

public function get_formatted_template(): array {
	$arr = [
		$this->get_name(),
		$this->get_attributes(),
	];

	$inner_blocks = $this->get_inner_blocks_sorted_by_order();

	if ( ! empty( $inner_blocks ) ) {
		$arr[] = array_map(
			function( BlockInterface $block ) {
				return $block->get_formatted_template();
			},
			$inner_blocks
		);
	}

	return $arr;
}