Automattic\WooCommerce\Internal\Admin\Schedulers
OrdersScheduler::delete()
Delete a batch of orders.
Метод класса: OrdersScheduler{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = OrdersScheduler::delete( $batch_size );
- $batch_size(int) (обязательный)
- Number of items to delete.
Код OrdersScheduler::delete() OrdersScheduler::delete WC 9.2.3
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 ); } }