Auto Login After Registration

This topic contains 4 reply and 2 voices, and was last updated by Nayem 9 years, 8 months ago
Viewing 4 Posts - 1 through 4 (of 4 total)
Author Posts
March 28, 2015 at 11:50 pm 40192
Nayem Hello, I would like that the user after clicking on the registration link sent via email (after the complete the registration form), log-in automatically without that he must enter your username and password. How can I do? Thanks in advance
March 29, 2015 at 3:45 pm 40234
Nayem Nayem

Hello Marco,

You can visit here to get some idea about how to do this work – http://stackoverflow.com/questions/19949876/how-to-auto-login-after-registration-in-wordpress-with-core-php.

Thanks.

March 29, 2015 at 4:51 pm 40236
Nayem Nayem

In your theme’s function.php file you can insert those code to enable auto login after registration-

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( 'http://www.wpcoke.com' );
        wp_redirect( home_url() );
        exit;
    }
 add_action( 'user_register', 'auto_login_new_user' );
March 29, 2015 at 5:05 pm 40237
Marco Coco Marco Coco

Thanks but i want that users After that he click the email, automatically log-in, and not when he finish the registration form. How can i do that?

March 29, 2015 at 5:45 pm 40239
Nayem Nayem

Hello,

It will require more customization. I am really sorry to say that i can not help you about this. You may require a developer to do this for you. We do not provide support for customization. We only provide support for our built in feature.

Thank you 🙂

Viewing 4 Posts - 1 through 4 (of 4 total)