Automattic\WooCommerce\Internal\Admin\Schedulers

OrdersScheduler::maybe_schedule_import_on_trash │ public static │ WC 11.1.0

Schedule an analytics import when an HPOS order is trashed.

CPT fires this hook too, on top of trashed_post, so it is handled there instead.

Method of the class: OrdersScheduler{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = OrdersScheduler::maybe_schedule_import_on_trash( $order_id ): void;
$order_id(int) (required)
Order ID.

Changelog

Since 11.1.0 Introduced.

OrdersScheduler::maybe_schedule_import_on_trash() code WC 11.1.2

public static function maybe_schedule_import_on_trash( $order_id ): void {
	if ( ! OrderUtil::custom_orders_table_usage_is_enabled() ) {
		return;
	}

	self::possibly_schedule_import( $order_id );
}