WC_Privacy::anonymize_completed_orders( int $limit = 20 )
Anonymize old completed orders.
Description Description
Parameters Parameters
- $limit
-
(Optional) Limit orders to process per batch.
Default value: 20
Return Return
(int) Number of orders processed.
Source Source
File: includes/class-wc-privacy.php
public static function anonymize_completed_orders( $limit = 20 ) { $option = wc_parse_relative_date_option( get_option( 'woocommerce_anonymize_completed_orders' ) ); if ( empty( $option['number'] ) ) { return 0; } return self::anonymize_orders_query( apply_filters( 'woocommerce_anonymize_completed_orders_query_args', array( 'date_created' => '<' . strtotime( '-' . $option['number'] . ' ' . $option['unit'] ), 'limit' => $limit, // Batches of 20. 'status' => 'wc-completed', 'anonymized' => false, 'type' => 'shop_order', ) ) ); }
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |