WC_Privacy::trash_orders_query( array $query )
For a given query trash all matches.
Description Description
Parameters Parameters
- $query
-
(Required) Query array to pass to wc_get_orders().
Return Return
(int) Count of orders that were trashed.
Source Source
File: includes/class-wc-privacy.php
protected static function trash_orders_query( $query ) { $orders = wc_get_orders( $query ); $count = 0; if ( $orders ) { foreach ( $orders as $order ) { $order->delete( false ); $count ++; } } return $count; }
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |