Is there a hook similar to the one below but for when a user logs in (not registers)?
//This action is called whenever Social Login adds a new user add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10, 2);
No, there isn't. There is: - oa_social_login_action_before_user_login - wp_login (for Wordpress login hook) - oa_social_login_action_before_user_redirect (after login or register, and before redirection, which is the next step). Would you need some specific action ?
From the portion of it pasted below, I found that there is also a $new_registration parameter. I was able to use this and it looks like it should weed out the registration ones from pure sign up.
-Jonah
//This function will be called before Social Login logs the the user in function oa_social_login_do_before_user_login ($user_data, $identity, $new_registration) { //true for new and false for returning users if ($new_registration) { echo "I am a new user"; } else { echo "I am a returning user"; }
//These are the fields from the WordPress database print_r($user_data);
//This is the full social network profile of this user print_r($identity); } add_action ('oa_social_login_action_before_user_login', 'oa_social_login_do_before_user_login', 10, 3);
Answers
https://github.com/wp-plugins/oa-social-login/blob/master/filters.txt
From the portion of it pasted below, I found that there is also a $new_registration parameter. I was able to use this and it looks like it should weed out the registration ones from pure sign up.
-Jonah
//This function will be called before Social Login logs the the user in
function oa_social_login_do_before_user_login ($user_data, $identity, $new_registration)
{
//true for new and false for returning users
if ($new_registration)
{
echo "I am a new user";
}
else
{
echo "I am a returning user";
}
//These are the fields from the WordPress database
print_r($user_data);
//This is the full social network profile of this user
print_r($identity);
}
add_action ('oa_social_login_action_before_user_login', 'oa_social_login_do_before_user_login', 10, 3);