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.

No Hooks.

Return

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

Usage

wc_get_container() : \Psr\Container\ContainerInterface;

Changelog

Since 4.4.0 Introduced.

Code of wc_get_container() WC 6.8.2

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