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

  1. if ( !function_exists( 'wp_lostpassword_url' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4. // Path to redirect to on login. 
  5. $redirect = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_lostpassword_url($redirect); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function wp_lostpassword_url( $redirect = '' ) { 
  2. $args = array( 'action' => 'lostpassword' ); 
  3. if ( !empty($redirect) ) { 
  4. $args['redirect_to'] = $redirect; 
  5.  
  6. $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') ); 
  7.  
  8. /** 
  9. * Filters the Lost Password URL. 
  10. * @since 2.8.0 
  11. * @param string $lostpassword_url The lost password page URL. 
  12. * @param string $redirect The path to redirect to on login. 
  13. */ 
  14. return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );