wp_lostpassword_url
Returns the URL that allows the user to retrieve the lost password.
Description
(string) wp_lostpassword_url( (string) $redirect = '' );
Returns (string)
Lost password URL.
Parameters (1)
- 0. $redirect — Optional. (string) =>
''
- Path to redirect to on login.
Usage
if ( !function_exists( 'wp_lostpassword_url' ) ) { require_once ABSPATH . WPINC . '/general-template.php'; } // Path to redirect to on login. $redirect = ''; // NOTICE! Understand what this does before running. $result = wp_lostpassword_url($redirect);
Defined (1)
The function is defined in the following location(s).
- /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') );
- /**
- * Filters the Lost Password URL.
- *
- * @since 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 );
- }