How to get values for user ID and Identity ?

edited July 2017 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

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited July 2017 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

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.