Make WordPress Core


Ignore:
Timestamp:
05/11/2010 01:44:40 PM (14 years ago)
Author:
ryan
Message:

Force reauth when auth_redirect() redirects to login. see #12142

File:
1 edited

Legend:

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

    r14499 r14556  
    229229 *
    230230 * @param string $redirect Path to redirect to on login.
    231  */
    232 function wp_login_url($redirect = '') {
     231 * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
     232 * @return string A log in url
     233 */
     234function wp_login_url($redirect = '', $force_reauth = false) {
    233235    $login_url = site_url('wp-login.php', 'login');
    234236
    235     if ( !empty($redirect) ) {
     237    if ( !empty($redirect) )
    236238        $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);
    237     }
     239
     240    if ( $force_reauth )
     241        $login_url = add_query_arg('reauth', '1', $login_url);
    238242
    239243    return apply_filters('login_url', $login_url, $redirect);
Note: See TracChangeset for help on using the changeset viewer.