Make WordPress Core

Changeset 11448


Ignore:
Timestamp:
05/24/2009 08:58:22 PM (16 years ago)
Author:
westi
Message:

Add a wp_lostpassword_url() function to complete the set. Based on patch from ramiy fixes #9932.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r11430 r11448  
    195195
    196196    return apply_filters('login_url', $login_url, $redirect);
     197}
     198
     199/**
     200 * Returns the Lost Password URL.
     201 *
     202 * Returns the URL that allows the user to retrieve the lost password
     203 *
     204 * @since 2.8.0
     205 * @uses site_url() To generate the lost password URL
     206 * @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url
     207 *
     208 * @param string $redirect Path to redirect to on login.
     209 */
     210function wp_lostpassword_url($redirect = '') {
     211    $args = array( 'action' => 'lostpassword' );   
     212    if ( !empty($redirect) ) {
     213        $args['redirect_to'] = $redirect;
     214    }
     215
     216    $lostpassword_url = add_query_arg($args, site_url('wp-login.php', 'login'));
     217    return apply_filters('lostpassword_url', $lostpassword_url, $redirect);
    197218}
    198219
Note: See TracChangeset for help on using the changeset viewer.