Support » Plugin: WordPress Social Login » [Plugin: WordPress Social Login] WSL Not compatible with BuddyPress – Facebook Login

Viewing 7 replies - 1 through 7 (of 7 total)
  • In plugin.auth.php

    $userdata = array(
    			'user_login'    => $user_login,
    			'user_email'    => $user_email,
    
    			'first_name'    => $hybridauth_user_profile->firstName,
    			'last_name'     => $hybridauth_user_profile->lastName,
    			//'user_nicename' => $hybridauth_user_profile->displayName,
    			'user_nicename' => $hybridauth_user_profile->$user_login,
    			'display_name'  => $hybridauth_user_profile->displayName,
    			'user_url'      => $hybridauth_user_profile->profileURL,
    			'description'   => $hybridauth_user_profile->description,
    
    			'user_pass'     => wp_generate_password()
    		);

    See change made for user_nicename, inserting user login rather than the display_name value which kills buddypress profile links.

    looks like an easy update to the files, the only issue is now we need to update the db to fix previously entered user_nicename values.

    Not sure why I did it the other way, I guess they both work but this method is cleaner I suppose.

    $userdata = array(
    			'user_login'    => $user_login,
    			'user_email'    => $user_email,
    			'user_nicename' => $user_login,
    
    			'first_name'    => $hybridauth_user_profile->firstName,
    			'last_name'     => $hybridauth_user_profile->lastName,
    			//'user_nicename' => $hybridauth_user_profile->displayName,
    			'display_name'  => $hybridauth_user_profile->displayName,
    			'user_url'      => $hybridauth_user_profile->profileURL,
    			'description'   => $hybridauth_user_profile->description,
    
    			'user_pass'     => wp_generate_password()
    		);

    Here is a “final” solution for this issue.

    Since $user_login is already converted to lowercase, however it does insert a “_” if there is a space, I then strip the underscore and make the user_nicename an all one word lowercase slug.

    $user_nicename = trim( str_replace( '_', '', $user_login ) );
    
    		$userdata = array(
    			'user_login'    => $user_login,
    			'user_email'    => $user_email,
    			'user_nicename' => $user_nicename,
    
    			'first_name'    => $hybridauth_user_profile->firstName,
    			'last_name'     => $hybridauth_user_profile->lastName,
    			//'user_nicename' => $hybridauth_user_profile->displayName,
    			'display_name'  => $hybridauth_user_profile->displayName,
    			'user_url'      => $hybridauth_user_profile->profileURL,
    			'description'   => $hybridauth_user_profile->description,
    
    			'user_pass'     => wp_generate_password()
    		);

    This code in the plugin.auth.php file (near the bottom of file) does the trick. Now WSL works with both buddypress and non-buddypress installations as long as you hook WSL into your buddypress registration form.

    Like so:

    # Add WordPress Social Login
    		if (has_filter('activate_wordpress-social-login/wp-social-login.php')) {
    
    		# Login/Registration Button Location
    		add_action ('bp_before_account_details_fields', 'wsl_render_login_form_login'); # Top of registration form
    		//add_action ('bp_before_registration_submit_buttons', 'wsl_render_login_form_login'); # Bottom of registration form
    		}

    This of course should be incorporated into the WSL plugin directly to hook into the BP forms if BP is enabled.

    I am pretty sure i am having the problem you have fixed.

    When someone registers or logs in with WPSL when they try and go through thier profile and other options with buddypress i get 404’s.

    Hopefully your fix will solve the problem. Thanks i owe you a beer.

    I actually think the latest update to the pplugin may have fixed this?

    Not sure if they have fixed this in the latest release, haven’t looked at the code, but it seems like it should be a very simple fix to implement. It would be nice to not need to hack the code to get it to work with buddypress.

    ;o)

    Maybe the developer will chime in on this?

    P.S. I like micro brews… LOL.

    Has this been updated to work with buddypress???

    Guess i should give it a try

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: WordPress Social Login] WSL Not compatible with BuddyPress – Facebook Login’ is closed to new replies.