//Use the email address as user_login
function oa_social_login_set_email_as_user_login ($user_fields)
{
if ( ! empty ($user_fields['user_email']))
{
if ( ! username_exists ($user_fields['user_email']))
{
$user_fields['user_login'] = $user_fields['user_email'];
}
}
return $user_fields;
}
//This filter is applied to new users
add_filter('oa_social_login_filter_new_user_fields', 'oa_social_login_set_email_as_user_login');
function oa_social_login_update_user($user_data, $identity)
{
wp_update_user (array( 'ID' => $user_data->ID, 'user_login' => $user_data->ID));
}
//This action is called whenever Social Login adds a new user
add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_update_user', 10, 2);
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.
Answers
Thanks
Please have a look at section 3 here:
http://docs.oneall.com/plugins/guide/social-login-wordpress/#3