how to redirect to a custom password retrieval page

not sure i really follow you either, BUT what about filtering the wp_lostpassword_url

from wp-includes/general-template.php

function wp_lostpassword_url( $redirect="" ) {
            $args = array( 'action' => 'lostpassword' );
            if ( !empty($redirect) ) {
                    $args['redirect_to'] = $redirect;
            }

            $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
            return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
}

looks like it has a filter you could use to point it to your custom URL, and even add your ‘getpass’ query var

Here’s a very basic example:

function custom_login_lostpassword_url()
{
    // use a site_url/plugins_url to output the correct URL.
    return "http://.../my-custom-lostpassword-screen.php";
}

add_filter("lostpassword_url", "custom_login_lostpassword_url");

Leave a Comment