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

Automattic\WooCommerce\Blocks\Registry

Container::register() public WC 1.0

Interface for registering a new dependency with the container.

By default, the $value will be added as a shared dependency. This means that it will be a single instance shared among any other classes having that dependency.

If you want a new instance every time it's required, then wrap the value in a call to the factory method (@see Container::factory for example)

Note: Currently if the provided id already is registered in the container, the provided value is ignored.

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

Хуков нет.

Возвращает

Null. Ничего.

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

$Container = new Container();
$Container->register( $id, $value );
$id(строка) (обязательный)
A unique string identifier for the provided value. Typically it's the fully qualified name for the dependency.
$value(смешанный) (обязательный)
The value for the dependency. Typically, this is a closure that will create the class instance needed.

Код Container::register() WC 4.7.1

<?php
public function register( $id, $value ) {
	if ( empty( $this->registry[ $id ] ) ) {
		if ( ! $value instanceof FactoryType ) {
			$value = new SharedType( $value );
		}
		$this->registry[ $id ] = $value;
	}
}