Skip to:
Content
Pages
Categories
Search
Top
Bottom

Empty login submissions go to wp-login.php page

Viewing 2 replies - 1 through 2 (of 2 total)

  • Tanya
    Participant

    @pjtna

    In your functions.php file add this code

    add_action('login_redirect', 'redirect_login', 10, 3);
    function redirect_login($redirect_to, $url, $user) {
    if($user->errors['empty_password']){
    wp_redirect(get_bloginfo('url').'/log-in-error/');
    }
    else if($user->errors['empty_username']){
    wp_redirect(get_bloginfo('url').'/log-in-error/');
    }
    else if($user->errors['invalid_username']){
    wp_redirect(get_bloginfo('url').'/log-in-error/');
    }
    else if($user->errors['incorrect_password']){
    wp_redirect(get_bloginfo('url').'/log-in-error/');
    }
    else{
    wp_redirect(get_bloginfo('url').'/forums/');
    }
    exit;
    }

    I created a page in wordpress called “log in error”, and chose that as the page to be redirected to if you do an incorrect login. In that page I wrote “Your username or password was incorrect. Please try again.” And then I chose bbPress – User Log In as the Template.


    Tanya
    Participant

    @pjtna

    Sorry, the code didn’t come up quite properly. Use this instead:

    http://pastebin.com/XA2BPBhx

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar