Do not export a customer data group containing no data
This commit is contained in:
parent
c68b8faa99
commit
bfb6bff87c
|
@ -25,12 +25,15 @@ class WC_Privacy_Exporters {
|
|||
$data_to_export = array();
|
||||
|
||||
if ( $user instanceof WP_User ) {
|
||||
$data_to_export[] = array(
|
||||
'group_id' => 'woocommerce_customer',
|
||||
'group_label' => __( 'Customer Data', 'woocommerce' ),
|
||||
'item_id' => 'user',
|
||||
'data' => self::get_customer_personal_data( $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' ),
|
||||
'item_id' => 'user',
|
||||
'data' => $customer_personal_data,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
|
|
Loading…
Reference in New Issue