• Resolved F R

    (@frosado)


    Hello. When we activate the ‘Auto Login New User After Registration’ plugin, new users registrations on the site no longer save first name or last name. Our registration form collects both first name and last name, but once this plugin is activated the users are registered, a new account is created, but their WordPress profiles lack First Name and Last Name.

    We tried enabling the fields in the ADD FIELDS TO NEW USER REGISTRATION FORM and we also tried it with them disabled, but it still will not record the new user’s First name and last name in the WordPress profile.

    If you create a test registration on our site (https://boxofficefunding.com/login) you will see Hello [blank] at the top right, and under your Profile there is no First or Last name. In the back-end we see no First Name or Last Name. Email and password ARE correctly saved in the new user profile.

    Is there any way to fix this so we can capture first name and last name from our registration form?

    Thank you!

    We are using:
    Wordpress Version 5.3.2
    Theme: Pay Day Loans Version 1.0.0
    Using: Ultimate Member 2.1.4 (for registration form)

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jeff Sherk

    (@jsherk)

    You said “no longer save first name or last name”, so this suggests that you were already collecting first and last names with your current registration page, is that correct?

    Plugin Author Jeff Sherk

    (@jsherk)

    The default behavior for wordpress is NOT to collect first name or last name when somebody registers, so if you were collecting first and last name then it is either your theme or another plugin that was allowing that.

    And then when I do a test login, it takes me to /my-profile/ page which is NOT the wordpress standard profile page.

    So if you login as admin, and then go to Users and click on edit for one of the new user that was created with my plugin, you will probably see that the first name and last name are indeed filled in (for WordPress profile).

    The /my-profile/ page is theme/plugin specific and is not using the wordpress profile fields for first or last name which is why they are not showing up (because my plugin uses the standard wordpress first name and last name profile fields).

    • This reply was modified 5 years ago by Jeff Sherk.
    Thread Starter F R

    (@frosado)

    Thank you for your prompt response!!

    We have been collecting First Name and Last Name using the Unlimited Member Plugin. Our users must register with First Name, Last Name, Email, and Password. We then show the user’s first name in the menus such as “Hello Test”.

    We have set a redirect to the Profile page upon registration. We want to use the Auto Login plugin to send them to this protected (logged in users only) page immediately after they register. (Ideally we want no email sent to them as they have completed the registration process. But that is a different topic.)

    Users are now NOT receiving a First Name or Last Name value in their WordPress user profile. That is why we can’t display their name in the menu—the WP profile lacks their name. For example, the user Test Test which just registered on the site has not first name or last name values in the backend Users section of WordPress.

    If we deactivate the plugin then new registrations do save their first name and last name.

    Any ideas for what we can try to fix this?

    Thanks!

    Plugin Author Jeff Sherk

    (@jsherk)

    Thanks for the additional information.

    Most likely the issue is incompatibility with one of the other plugins (probably Unlimited Member plugin). So the other plugin is somehow intercepting the information from my plugin so it is not getting saved.

    So if you disable your other plugins, does my plugin then save the the first and last name info? If yes, then unfortunately you will not be able to use them both at the same time.

    Thread Starter F R

    (@frosado)

    I uploaded a screenshot of a user profile from the WP backend. You can see it here:

    https://boxofficefunding.com/no_name.png

    Thanks Jeff!!

    Thread Starter F R

    (@frosado)

    I see. Let me do a compatibility check then by turning off UM first then others one at a time to see if we can get the names to save with the auto login plugin activated.

    The plugin is doing a great job login in new users automatically, so it would be a shame if we end up not able to use it!

    I’ll report back with the results of the compatibility check.

    Thread Starter F R

    (@frosado)

    Hi Jeff,

    It does seem that UM is conflicting with Auto Login. That’s too bad.

    I even tried using the following code in functions.php and the problem persists. I’m going to write to UM now.

    function auto_login_new_user( $user_id ) {
    wp_set_current_user($user_id);
    wp_set_auth_cookie($user_id);
    // You can change home_url() to the specific URL,such as
    //wp_redirect( ‘https://www.wpcoke.com’ );
    wp_redirect( home_url() );
    exit;
    }
    add_action( ‘user_register’, ‘auto_login_new_user’ );

    This code does the trick to auto login, but it results in the same issue–First Name and Last Name are not saved in the WP user profile.

    Just FYI. Will be contacting UM now. Thanks still for the help!

    Thread Starter F R

    (@frosado)

    Solved it. I added the following to functions.php. This method of auto-login did not conflict with Ultimate Member and successfully logged in the user after registration and saves the first name and last name fields correctly in the WordPress user profile.

    Just passing it along for anyone else who may have this issue and it case it helps you Jeff with future updates to the plugin. Thanks!

    function auto_login_new_user( $user_id ) {
            wp_set_current_user($user_id);
            wp_set_auth_cookie($user_id);
        }
        add_action( 'user_register', 'auto_login_new_user' );
    Thread Starter F R

    (@frosado)

    Thx

    Plugin Author Jeff Sherk

    (@jsherk)

    Glad you figured it out.

    Thanks for sharing your solution!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘First & Last Name not saved to new user profile’ is closed to new replies.