WordPress.org

Ready to get started?Download WordPress

Codex

Attention 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) (required) path to redirect to
Default: None

Examples

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

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

Change Log

Since Version 2.8

Source Files

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

Related