• In my testing I have found that SuperSocializer appears to take the user’s first and last name to create the user_login which becomes “firstname-lastname”. Also, the “user_nicename” field is populated with “firstname”.

    A few questions regarding this if I may:

    1. What is the expected behavior when 2 people with the exact same name create an account on the site using Super Socializer? The first user will get the below:

    user_login: Dave-Smith
    user_nicename: Dave

    What happens for the second Dave Smith who registers with the site?
    Does it become like below?

    user_login: Dave-Smith2
    user_nicename: Dave2

    *As WordPress cannot allow duplicate “user_logins” would be correct to assume the above happens when a user with the same nice registers?

    2. Is there anyway to get the user_nicename value to be the same as user-login (firstname-lastname)?

    https://www.ads-software.com/plugins/super-socializer/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Heateor Support

    (@heateor)

    1. What is the expected behavior when 2 people with the exact same name create an account on the site using Super Socializer? The first user will get the below

    First user will get user_login value – first_name-last_name and user_nicenamefirst_name
    Second user with exact same name, will have user_login value – first_name-last_name2 and user_nicename with value first_name-2

    2. Is there anyway to get the user_nicename value to be the same as user-login (firstname-lastname)?

    Yes, you can change the user_nicename value to user_login by placing following code in functions.php file of your current child theme/theme

    function update_user_nicename( $userId, $userdata, $profileData ) {
    	$user = wp_update_user( array( 'ID' => $userId, 'user_nicename' => $userdata['user_login'] ) );
    
    	if ( is_wp_error( $user ) ) {
    	    // There was an error
    	} else {
    	    // Hurray! You made it
    	}
    }
    add_action( 'the_champ_user_successfully_created', 'update_user_nicename', 10, 3 );

    Thread Starter donburikun

    (@donburikun)

    Thank you for your reply and the code. Did you write that in reply to my post or was it already being used for something else?

    Does this update the user_nicename after the fact to match the user_login value? Is there any way to make the user_nicename be the same as the user_login from the moment it is created (when a user registers)?

    I ask because, in my case, I have a link created that when clicked takes the user to the Buddypress PM compose page and auto-populates the “Send to” field with the user_login value. But it seems that Buddypress expects it to be the user_nicename value so when it does not match the user_login value it fails with the message “Message could not be sent because you have entered an invalid username. Please try again.”.

    To overcome this I would simply need the user_login and user_nicename values to match.

    Plugin Author Heateor Support

    (@heateor)

    Thank you for your reply and the code. Did you write that in reply to my post or was it already being used for something else?

    We have written it for you.

    Does this update the user_nicename after the fact to match the user_login value? Is there any way to make the user_nicename be the same as the user_login from the moment it is created (when a user registers)?

    Yes, it updates user_nicename at the moment when user registers via Social Login. You cannot insert/update the code directly where user registers. That’s why we have used a hook to do this.

    Thread Starter donburikun

    (@donburikun)

    Thank you very much for your very kind support!

    Plugin Author Heateor Support

    (@heateor)

    You’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How does SuperSocializer handle duplicate names?’ is closed to new replies.