From 57f9a2c10f7d522af5f45c62e4d04360b82f07ee Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 17:42:44 +0000 Subject: [PATCH] Login and Registration: Correct the logic for determining the path to `wp-login.php` in `wp_lostpassword_url()`. Follow-up to [48672], [48673]. See #39311. git-svn-id: https://develop.svn.wordpress.org/trunk@48674 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 82228c2021..f88e342ce2 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -613,14 +613,14 @@ function wp_lostpassword_url( $redirect = '' ) { $args['redirect_to'] = urlencode( $redirect ); } - $site_path = ''; - if ( is_multisite() ) { - $blog_details = get_blog_details(); - $site_path = $blog_details->path . 'wp-login.php'; + $blog_details = get_blog_details(); + $wp_login_path = $blog_details->path . 'wp-login.php'; + } else { + $wp_login_path = 'wp-login.php'; } - $lostpassword_url = add_query_arg( $args, network_site_url( $site_path . 'wp-login.php', 'login' ) ); + $lostpassword_url = add_query_arg( $args, network_site_url( $wp_login_path, 'login' ) ); /** * Filters the Lost Password URL.