wp_lostpassword_url( string $redirect = '' )
Returns the URL that allows the user to reset the lost password.
Parameters
- $redirect
-
(Optional) Path to redirect to on login.
Default value: ''
Return
(string) Lost password URL.
Source
File: wp-includes/general-template.php
function wp_lostpassword_url( $redirect = '' ) {
$args = array( 'action' => 'lostpassword' );
if ( !empty($redirect) ) {
$args['redirect_to'] = urlencode( $redirect );
}
$lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
/**
* Filters the Lost Password URL.
*
* @since WP-2.8.0
*
* @param string $lostpassword_url The lost password page URL.
* @param string $redirect The path to redirect to on login.
*/
return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
}
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |