Automattic\WooCommerce\Internal\Admin\BlockTemplateRegistry

BlockTemplateRegistry::register()publicWC 1.0

Register a single template.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$BlockTemplateRegistry = new BlockTemplateRegistry();
$BlockTemplateRegistry->register( $template );
$template(массив) (обязательный)
Template layout.

Код BlockTemplateRegistry::register() WC 8.1.1

public function register( BlockTemplateInterface $template ) {
    $id = $template->get_id();

    if ( isset( $this->templates[ $id ] ) ) {
			throw new \ValueError( 'A template with the specified ID already exists in the registry.' );
		}

    $this->templates[ $id ] = $template;
}