Skip to:
Content
Pages
Categories
Search
Top
Bottom

My Auto login function needs a Lil something


  • threwthenevr
    Participant

    @threwthenevr

    I have a function that automatically logs in a user who just registered on my website, this is the code

    // auto log in a user who has just signed up
    function wpbp_auto_login_new_user( $user_id ) {
    wp_set_current_user( $user_id );
    wp_set_auth_cookie( $user_id, false, is_ssl() );
    }
    add_action( ‘user_register’, ‘wpbp_auto_login_new_user’ );

    I’d like to add more to it like if the new registered user has not activated their account to have them redirected to a different page?

    By any chance does anyone know how could achieve this?

  • You must be logged in to reply to this topic.
Skip to toolbar