WordPress at Your Fingertips
function is not described

WC_Checkout::instance() public WC 2.1

Gets the main WC_Checkout Instance.

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

Hooks from the method

Return

WC_Checkout. Main instance

Usage

$result = WC_Checkout::instance();

Changelog

Since 2.1 Introduced.

Code of WC_Checkout::instance() WC 5.9.0

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

		// Hook in actions once.
		add_action( 'woocommerce_checkout_billing', array( self::$instance, 'checkout_form_billing' ) );
		add_action( 'woocommerce_checkout_shipping', array( self::$instance, 'checkout_form_shipping' ) );

		// woocommerce_checkout_init action is ran once when the class is first constructed.
		do_action( 'woocommerce_checkout_init', self::$instance );
	}
	return self::$instance;
}