Changeset 2671569
- Timestamp:
- 02/02/2022 06:23:26 PM (4 years ago)
- File:
-
- 1 edited
-
socialproofy/trunk/socialproofy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
socialproofy/trunk/socialproofy.php
r2671564 r2671569 85 85 $users_query = get_users(); 86 86 foreach ($users_query as $key => $item) { 87 if ($key > 30) break; 87 if ($key > 30) 88 break; 88 89 $customer = socialproofy_generate_customer_data($item->ID); 89 90 $customers[] = $customer; … … 439 440 function socialproofy_generate_customer_data($user_id) 440 441 { 441 $customer_data = get_user_meta($user_id); 442 443 return $customer_data; 442 $customer_data = array_map(function ($a) { 443 return $a[0]; 444 }, get_user_meta($user_id)); 445 446 if (!empty($customer_data)) { 447 $customer = array( 448 'customer_id' => $user_id, 449 'nickname' => $customer_data['nickname'], 450 'first_name' => $customer_data['first_name'], 451 'country' => $customer_data['billing_country'], 452 'city' => $customer_data['billing_city'], 453 ); 454 455 return $customer; 456 } 457 458 return null; 444 459 } 445 460
Note: See TracChangeset
for help on using the changeset viewer.