WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/lostpassword url

Description

lostpassword_url is a filter applied to the URL returned by the function wp_lostpassword_url(), allowing you to have that function direct users to a specific (different) URL for retrieving a lost password.

Parameters

$lostpassword_url
(string) (required) The URL for retrieving a lost password.
Default: None
$redirect
(string) (optional) The path to redirect to.
Default: None

Examples

The following example would return a lost password URL http://example.com/lostpassword/ for the wp_lostpassword_url() function:

add_filter( 'lostpassword_url', 'my_lost_password_page', 10, 2 );
function my_lost_password_page( $lostpassword_url, $redirect ) {
    return home_url( '/lostpassword/?redirect_to=' . $redirect );
}

Change Log

Since Version 2.8

Source File

lostpassword_url is located in wp-includes/general-template.php

Related