I altered my code in /wp-content/plugins/wordpress-social-login/includes/plugin.auth.php and set it to where if the user is logged in it will associate the new network with the current user and add the new user profile link but NOT replace the user avatar or other info.
The only thing you need to do is add the <?php do_action( ‘wordpress_social_login’ ); ?> somewhere on a template file to give the logged in user buttons to click.
under this:
// try to get user by meta if not
if( ! $user_id ){
$user_id = (int) wsl_get_user_by_meta( $provider, $hybridauth_user_profile->identifier );
}
added code at line 94
// try to check whether the active session is registered
if( is_user_logged_in() ) {
// the user is logged in, set $user_id to their id, don't make a new one
$user = get_current_user_id();
if( $user != 0 or 1) { // 0 is empty and 1 is the administrator, dont use the Admin account
$user_id = $user;
} //END if( $user != 0 or 1)
} //END if( is_user_logged_in() ) {
under this:
// not that precise you say... well welcome to my world
if( ! $user_age && (int) $hybridauth_user_profile->birthYear ){
$user_age = (int) date("Y") - (int) $hybridauth_user_profile->birthYear;
}
added code at line 180
//If user already exists only update the login identifier not the photo, age, gender, etc
if( is_user_logged_in() ) {
update_user_meta ( $user_id, 'user_url' , $hybridauth_user_profile->profileURL );
update_user_meta ( $user_id, $provider , $hybridauth_user_profile->identifier );
update_user_meta ( $user_id, 'wsl_user' , $provider );
} // END if( is_user_logged_in()
else {
under this:
update_user_meta ( $user_id, 'wsl_user' , $provider );
update_user_meta ( $user_id, 'wsl_user_gender', $hybridauth_user_profile->gender );
update_user_meta ( $user_id, 'wsl_user_age' , $user_age );
update_user_meta ( $user_id, 'wsl_user_image' , $hybridauth_user_profile->photoURL );
added code at line 194
} // END else if( is_user_logged_in()
I tried the code edits here first and it didn’t work: https://github.com/hybridauth/WordPress-Social-Login/commit/31ce56b4d0cfa3f735d22cfcb80e1c94beac051f