WordPress at Your Fingertips
function is not described

WC_Privacy::anonymize_custom_data_types() public WC 1.0

Handle some custom types of data and anonymize them.

{} It's a method of the class: WC_Privacy{}

No Hooks.

Return

String. Anonymized string.

Usage

$WC_Privacy = new WC_Privacy();
$WC_Privacy->anonymize_custom_data_types( $anonymous, $type, $data );
$anonymous(string) (required)
Anonymized string.
$type(string) (required)
Type of data.
$data(string) (required)
The data being anonymized.

Code of WC_Privacy::anonymize_custom_data_types() WC 5.9.0

public function anonymize_custom_data_types( $anonymous, $type, $data ) {
	switch ( $type ) {
		case 'address_state':
		case 'address_country':
			$anonymous = ''; // Empty string - we don't want to store anything after removal.
			break;
		case 'phone':
			$anonymous = preg_replace( '/\d/u', '0', $data );
			break;
		case 'numeric_id':
			$anonymous = 0;
			break;
	}
	return $anonymous;
}