Membership registration not saving WP Nick Name

Completing member registration using the Membership register page is not saving the Full Name as the WP Nick Name

I am running WP 3.61 and BuddyPress 1.81 and the BP XProfile WordPress User Sync plugin

When the Membership registration form is used there is a Full Name field. But the Nickname is not populated with it.

When completing registration using the BuddyPress register page no data is saved to the xProfile fields but the user does have the default subscription.

  • Alexander

    Hi @ericslangley,

    Are you referring to this plugin? http://wordpress.org/plugins/bp-xprofile-wp-user-sync/

    I just wanted to confirm, as it's relatively new. It's also not something we'd be able to guarantee compatibility for with our plugins.

    I suspect the problem is that because the Membership plugin overrides a good portion of the WordPress registration process, that some of the needed hooks are not executed in order for this to work.

    It might be as easy as adding an extra hook to the sync plugin for compatibility. I can't promise this will work as expected, but I could look into it further for you. Just let me know if I'm looking at the right plugin.

    Best regards,

  • ericslangley

    Alexander,

    Yes, that is the correct plugin.

    For testing purposes, on a different dev site, I disabled the plugin, created new First Name and Last Name xProfile fields and then registered as a new user.

    The result was that the BuddyPress xProfile fields Full Name, First Name and Last Name were populated but NOT the WordPress nickname and First Name, Last Name fields.

    If you Edit the profile as the user and simply click save the WP profile First Name, Last Name and Nickname are updated.

    This functions exactly the same way when the BP XProfile WordPress User Sync plugin is enabled. Editing, even without making changes, and then Saving updates the WP info.

    ~eric

  • Alexander

    Hi @ericslangley,

    Thanks for confirming! I don't have a test environment setup for this at the moment, but at a glance, it looks like we can simply do this by hooking your plugin up to the Membership form. This should take care of that:

    function xprofile_update_for_membership($errors, $user_id) {
        if(!$user_id) return;
    
        global $bp_xprofile_wordpress_user_sync;
        $bp_xprofile_wordpress_user_sync->intercept_wp_user_update($user_id);
    }
    add_action('membership_subscription_form_registration_process','xprofile_update_for_membership',10,2);

    This is in theory as I haven't tested it. I wanted to get it to you quickly. Let me know if this works, if not I can set up a more controlled test environment with all the needed plugins.

    You can place this code in functions.php of a theme (or Child Theme), in your own plugin, or using something like Code Snippets.

    Best regards,