Forums

wp_login_failed not working if only one field is filled out (4 posts)

  1. jst
    Member
    Posted 7 months ago #

    Hi

    I created a login form in the frontend with wp_login_form(). In my functions.php I added an action to prevent the redirect to /wp-login.php if the login failed with add_action('wp_login_failed', …
    As it turns out the action only hooks if the username AND password fields are filled in. If one of them is left empty I still get redirected to wp-login.php.

    Is there a possibility to check if both fields are filled in to prevent the redirect?

    Thanks, Julian

  2. Jackson
    Member
    Posted 7 months ago #

    wp_authenticate which calls do_action('wp_login_failed'... is a pluggable function (http://codex.wordpress.org/Pluggable_Functions), so you could copy it from pluggable.php to your theme's functions file and modify to suit your needs.

  3. jst
    Member
    Posted 7 months ago #

    Hi Jackson

    Thanks a lot for your reply! Got this to work now and learned something new!

    Thanks again
    Julian

  4. webladynz
    Member
    Posted 6 months ago #

    I have the same problem, but being new to WP I do not understand how you solved this issue. Your assitance would be most appreciated

Reply

You must log in to post.

About this Topic