The theme i am using is WPLMS-Wordpress learning managment system.

When user fill all the details for signup and click on register button. I don't want to activate the user manually I want when user click on register button it automatically activate it's account and go for login.

And the main problem is Every time when user signup I have to go for Dashboard USERS->PENDING USER->Activate or DELETE.I want user will automatically activate his/her account.

Help me out.


You can use the built in wordpress function wp_signon.

/// Auto login new user
    $creds = array();
    $creds['user_login'] = $username;
    $creds['user_password'] = $userpass;
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
        if ( is_wp_error($user) )
        echo $user->get_error_message();

$username and $userpass would be posted data from your register form.

Check the wordpress codex for full details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.