• Resolved josephparsley

    (@josephparsley)


    Hello. I’ve created a front-end login form using your plugin, and it works fine for most purposes and in most use cases. However, when a user enters incorrect credentials into the form, they’re redirected to the wp-login.php page.

    Is this expected behavior? Is there a way within the plugin to prevent this? I’d really rather the user stay on the front-end login page rather than get redirected in all cases.

    If this isn’t expected behavior and normally it’d give a validation error on that front-end form, can you think of anything that might make this functionality break?

    This might be a bit hard to troubleshoot without a site URL, but I can’t really provide that, unfortunately.

    Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello @josephparsley,

    This shouldn’t be the case. The page where the form is placed should refresh and show the error that just happened.

    This might be a bit hard to troubleshoot without a site URL, but I can’t really provide that, unfortunately.
    I’d really like an URL to inspect the form and try this out. You can’t share the URL with us or you don’t want to post it here since it’s a public forum ?
    If it’s the latter you can open a support ticket on our website with the details about this issue.

    Regards.

    Thread Starter josephparsley

    (@josephparsley)

    Hello Georgian,

    Thanks for the reply. It turns out there was another plugin that was hooking into ‘wp_login_failed’ and redirecting to wp-login.php. I’ve found the source of the problem, but now I need to resolve it.

    This plugin is something I need to keep using, but it already has a mechanism for working around it built in. Is it possible to add additional fields to the login form? I’d like to add a hidden field that contains the data that I need, if I can. But I don’t know if it’s possible to modify the login form without actually modifying plugin code.

    Thanks for your help again!

    Plugin Author Georgian Cocora

    (@raster02)

    Hello @josephparsley,

    You can use the <a href="https://developer.www.ads-software.com/reference/hooks/login_form_bottom/">login_form_bottom</a> WordPress filter in order to achieve this.

    Example:

    add_filter( 'login_form_bottom', 'wppbc_login_form_bottom_extra', 20, 2 );
    function wppbc_login_form_bottom_extra( $content, $args ){
        if($args['id_submit'] == 'wppb-submit')
            $content .= '<input type="hidden" value="important" />';
    
        return $content;
    }

    This will also only affect the login form created by Profile Builder.

    Let me know if it works or if you need more help with it !

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Failed login redirecting users to wp-login’ is closed to new replies.