WC_Checkout::instance()public staticWC 2.1

Gets the main WC_Checkout Instance.

Метод класса: WC_Checkout{}

Хуки из метода

Возвращает

WC_Checkout. Main instance

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

$result = WC_Checkout::instance();

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

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

Код WC_Checkout::instance() WC 8.7.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' ) );

		/**
		 * Runs once when the WC_Checkout class is first instantiated.
		 *
		 * @since 3.0.0 or earlier
		 */
		do_action( 'woocommerce_checkout_init', self::$instance );
	}
	return self::$instance;
}