WC_Privacy::anonymize_orders_query( array $query )

For a given query, anonymize all matches.


Description Description


Parameters Parameters

$query

(Required) Query array to pass to wc_get_orders().


Top ↑

Return Return

(int) Count of orders that were anonymized.


Top ↑

Source Source

File: includes/class-wc-privacy.php

	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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.