wc_get_container()WC 4.4.0

Returns the WooCommerce PSR11-compatible object container. Code in the includes directory should use the container to get instances of classes in the src directory.

Хуков нет.

Возвращает

\Psr\Container\ContainerInterface. The WooCommerce PSR11 container.

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

wc_get_container() : \Psr\Container\ContainerInterface;

Список изменений

С версии 4.4.0 Введена.

Код wc_get_container() WC 6.5.1

function wc_get_container() : \Psr\Container\ContainerInterface {
	return $GLOBALS['wc_container'];
}