Skip to content

Commit

Permalink
Do not send user meta data back in woocommerce_get_customer_details (
Browse files Browse the repository at this point in the history
…#40221)

* Do not send user meta data back in `woocommerce_get_customer_details`

* Add changefile(s) from automation for the following project(s): woocommerce

* Update plugins/woocommerce/changelog/fix-meta-data-customer-details

Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 15, 2023
1 parent 26f5cd5 commit 73d18d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/fix-meta-data-customer-details
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Do not send user meta data back in `woocommerce_get_customer_details` response.
2 changes: 2 additions & 0 deletions plugins/woocommerce/includes/class-wc-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ public static function get_customer_details() {
$data['date_created'] = $data['date_created'] ? $data['date_created']->getTimestamp() : null;
$data['date_modified'] = $data['date_modified'] ? $data['date_modified']->getTimestamp() : null;

unset( $data['meta_data'] );

$customer_data = apply_filters( 'woocommerce_ajax_get_customer_details', $data, $customer, $user_id );
wp_send_json( $customer_data );
}
Expand Down

0 comments on commit 73d18d4

Please sign in to comment.