WC_Checkout::instance()
Gets the main WC_Checkout Instance.
Description Description
Return Return
(WC_Checkout) Main instance
Source Source
File: includes/class-wc-checkout.php
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;
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.1 | Introduced. |