WordPress.org

Make WordPress Core

Ticket #21352: 21352.diff

File 21352.diff, 813 bytes (added by jamescollins, 8 years ago)
  • wp-includes/general-template.php

     
    358358                $args['redirect_to'] = $redirect;
    359359        }
    360360
    361         $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
     361        // If using WordPress multisite, use the user's primary blog (falling back to the current site when they don't have a primary blog)
     362        $blog_id = ( is_multisite() && get_current_user_id() ) ? get_user_meta( get_current_user_id(), 'primary_blog', true ) : null;
     363
     364        $lostpassword_url = add_query_arg( $args, get_site_url( $blog_id, 'wp-login.php', 'login') );
    362365        return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
    363366}
    364367