• Resolved GinaOrlando

    (@ginaorlando)


    I’ve been able to get the login and register forms functioning properly. However, once a user registers they are not automatically logged in. How can I make this happen? If I have to once users hit the register button I can redirect them to the login form but I’d rather not have to do that since it would feel redundant.

    https://www.ads-software.com/plugins/clean-login/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Alberto Hornero

    (@hornero)

    Hi GinaOrlando,

    So, do you want to include an automatic redirect to the login form when an user makes the registration successfully?

    This feature is not currently included in Clean Login, but if you want we can code it for you. Please write us an email if you are interested contacto(at)codection(dot)com

    Regards,

    Alberto.

    hello, the easiest solution for this problem would be to:
    1. open wp-content/plugins/clean-login/clean-login.php
    2. scroll to line 302 (tle last else statement of “// REGISTER a new user” section before wp_safe_redirect( $url );).
    3. paste this code:

    $creds = array();
    $creds['user_login'] = $_POST['username'];
    $creds['user_password'] = $_POST['pass1'];
    
    if($creds['user_login']!=''&&$creds['user_password']!=''){
    	$creds['remember'] = true;
    
    	wp_signon( $creds, false );
    	// this will redirect to the main page. if you want this
    	// to be a specific page you have to replace it with something
    	// like '/?page_id=123'
    	$redirect_to_link = '/';
    	wp_safe_redirect( $redirect_to_link );
    	return;
    }

    4. test and enjoy.

    Plugin Author Alberto Hornero

    (@hornero)

    Thanks RafalManka,

    Yes, it’s a quick solution. But take care with new plugin updates since these changes will be overwritten.

    Regards,

    Alberto.

    I added this feature and submitted a pull request.

    https://github.com/wp-plugins/clean-login/pull/1

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Have users logged in after registering’ is closed to new replies.