Pulling additional data
-
Hi There: What I am trying to achieve; update the user virtual wallet with their tokens from the external DB
I am able to pull across the user data. After looking through other threads on custom additional meta data, I found this code which you suggested for another user which also uses the $exlog_hook_action_authenticated
function get_player_data($wp_user, $exlog_user_data) {
$updated = update_user_meta( $wp_user, ‘lws_woovirtualwallet_amount’, $exlog_user_data[‘tokenscore’] );
// Checking if added ok
if ($updated) {
error_log(‘Additional field added’);
} else {
error_log(‘Unable to add additional field’);
}
}add_action(‘exlog_hook_action_authenticated’, ‘get_player_data’, 10, 2);
I’m not sure if I am doing this correctly, but I can confirm that the meta data entry ‘woovirtualwallet_amount” already exists in the wp_usermeta table, I am not sure if it is recognising the external DB ‘tokenscore’
Can I do something as method 1 mentioned here: What I am trying to achieve: update the user virtual wallet with their tokens from the external DB
or am I on the right path with pulling additional user data and assigning it to the meta?
Thanks
- The topic ‘Pulling additional data’ is closed to new replies.