WC_Privacy::anonymize_orders_query
For a given query, anonymize all matches.
Method of the class: WC_Privacy{}
No Hooks.
Returns
Int. Count of orders that were anonymized.
Usage
$result = WC_Privacy::anonymize_orders_query( $query );
- $query(array) (required)
- Query array to pass to wc_get_orders().
Changelog
| Since 3.4.0 | Introduced. |
WC_Privacy::anonymize_orders_query() WC Privacy::anonymize orders query code WC 10.3.6
protected static function anonymize_orders_query( $query ) {
$orders = wc_get_orders( $query );
$count = 0;
if ( $orders ) {
foreach ( $orders as $order ) {
WC_Privacy_Erasers::remove_order_personal_data( $order );
++$count;
}
}
return $count;
}