We are glad to welcome you to our Community Support Forums!
These forums are your way of communicating with the community of people developing and using tools provided by the OneAll platform.
The forums are run by the community and moderated by the OneAll team during office hours. Please stick to technical issues - and remember, no confidential information - these are public forums!

How to get values for user ID and Identity ?

edited July 13 in WordPress
Hello,
can anyone help me get values for the user ID and identity parameters?

function oa_social_login_store_extended_data ($user_data, $identity)
{
update_user_meta ($user_data->ID, 'gender', $identity->gender);
}
add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2);

I would like to use this hook to extended my user database, but the values for $user_data and $identity are returning NULL.

Best Answer

  • edited July 13 Answer ✓
    Hello,

    could you try something like this:

    function oa_social_login_store_extended_data ($user_data, $identity)
    {
    echo "oa_social_login_store_extended_data called:";
    var_dump($user_data);
    var_dump($identity);
    exit;
    }
    add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2);


    Please note that this hook is only called when a new user is being created.
    If the user already exists, he is simply logged in and the hook is not called.

Answers

Sign in with your OneAll account to take part in the discussion.