WC_Privacy_Exporters::customer_data_exporter( string $email_address )
Finds and exports customer data by email address.
Description Description
Parameters Parameters
- $email_address
-
(Required) The user email address.
Return Return
(array) An array of personal data in name value pairs
Source Source
File: includes/class-wc-privacy-exporters.php
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, ); }
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |