Automattic\WooCommerce\Internal\Admin\Schedulers

OrdersScheduler::delete()public staticWC 1.0

Delete a batch of orders.

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

Хуков нет.

Возвращает

null. Ничего.

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

$result = OrdersScheduler::delete( $batch_size );
$batch_size(int) (обязательный)
Number of items to delete.

Код OrdersScheduler::delete() WC 6.4.1

public static function delete( $batch_size ) {
	global $wpdb;

	$order_ids = $wpdb->get_col(
		$wpdb->prepare(
			"SELECT order_id FROM {$wpdb->prefix}wc_order_stats ORDER BY order_id ASC LIMIT %d",
			$batch_size
		)
	);

	foreach ( $order_ids as $order_id ) {
		OrdersStatsDataStore::delete_order( $order_id );
	}
}