WordPress at Your Fingertips
function is not described

WooCommerce::instance() public WC 2.1

Main WooCommerce Instance.

Ensures only one instance of WooCommerce is loaded or can be loaded.

{} It's a method of the class: WooCommerce{}

No Hooks.

Return

WooCommerce. - Main instance.

Usage

$result = WooCommerce::instance();

Notes

  • See: WC()

Changelog

Since 2.1 Introduced.

Code of WooCommerce::instance() WC 5.6.0

public static function instance() {
	if ( is_null( self::$_instance ) ) {
		self::$_instance = new self();
	}
	return self::$_instance;
}