Automattic\WooCommerce\Internal\Admin\Schedulers

OrdersScheduler::maybe_schedule_import_on_post_trash_change │ public static │ WC 11.1.0

Schedule an analytics import when a CPT-based order is trashed or untrashed.

The CPT admin UI trashes via wp_trash_post(), which fires no Woo-side signal. HPOS has its own handlers, so it is skipped here to avoid a duplicate import.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = OrdersScheduler::maybe_schedule_import_on_post_trash_change( $post_id ): void;
$post_id(int) (обязательный)
Post ID.

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

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

Код OrdersScheduler::maybe_schedule_import_on_post_trash_change() WC 11.3.0

public static function maybe_schedule_import_on_post_trash_change( $post_id ): void {
	if ( OrderUtil::custom_orders_table_usage_is_enabled() ) {
		return;
	}

	self::possibly_schedule_import( $post_id );
}