WordPress at Your Fingertips
function is not described

WC_Privacy_Exporters::customer_data_exporter() public WC 3.4.0

Finds and exports customer data by email address.

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

No Hooks.

Return

Array. An array of personal data in name value pairs

Usage

$result = WC_Privacy_Exporters::customer_data_exporter( $email_address );
$email_address(string) (required)
The user email address.

Changelog

Since 3.4.0 Introduced.

Code of WC_Privacy_Exporters::customer_data_exporter() WC 5.6.0

public static function customer_data_exporter( $email_address ) {
	$user           = get_user_by( 'email', $email_address ); // Check if user has an ID in the DB to load stored personal data.
	$data_to_export = array();

	if ( $user instanceof WP_User ) {
		$customer_personal_data = self::get_customer_personal_data( $user );
		if ( ! empty( $customer_personal_data ) ) {
			$data_to_export[] = array(
				'group_id'          => 'woocommerce_customer',
				'group_label'       => __( 'Customer Data', 'woocommerce' ),
				'group_description' => __( 'User’s WooCommerce customer data.', 'woocommerce' ),
				'item_id'           => 'user',
				'data'              => $customer_personal_data,
			);
		}
	}

	return array(
		'data' => $data_to_export,
		'done' => true,
	);
}