Automattic\WooCommerce\Blocks\Domain\Services

DraftOrders::init()publicWC 1.0

Set all hooks related to adding Checkout Draft order functionality to Woo Core.

{} Это метод класса: DraftOrders{}

Хуков нет.

Возвращает

null. Ничего.

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

$DraftOrders = new DraftOrders();
$DraftOrders->init();

Код DraftOrders::init() WC 7.1.0

public function init() {
	add_filter( 'wc_order_statuses', [ $this, 'register_draft_order_status' ] );
	add_filter( 'woocommerce_register_shop_order_post_statuses', [ $this, 'register_draft_order_post_status' ] );
	add_filter( 'woocommerce_analytics_excluded_order_statuses', [ $this, 'append_draft_order_post_status' ] );
	add_filter( 'woocommerce_valid_order_statuses_for_payment', [ $this, 'append_draft_order_post_status' ] );
	add_filter( 'woocommerce_valid_order_statuses_for_payment_complete', [ $this, 'append_draft_order_post_status' ] );
	// Hook into the query to retrieve My Account orders so draft status is excluded.
	add_action( 'woocommerce_my_account_my_orders_query', [ $this, 'delete_draft_order_post_status_from_args' ] );
	add_action( 'woocommerce_cleanup_draft_orders', [ $this, 'delete_expired_draft_orders' ] );
	add_action( 'admin_init', [ $this, 'install' ] );
}