From d1ef380858d30a2efe952b087a2337e246e601d2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 17:38:37 +0000 Subject: [PATCH] Login and Registration: Only call `get_blog_details()` in `wp_lostpassword_url()` on Multisite. The function does not exist on single site. Follow-up to [48672]. See #39311. git-svn-id: https://develop.svn.wordpress.org/trunk@48673 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 8ccb47c875..82228c2021 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -613,9 +613,14 @@ function wp_lostpassword_url( $redirect = '' ) { $args['redirect_to'] = urlencode( $redirect ); } - $blog_details = get_blog_details(); + $site_path = ''; - $lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php', 'login' ) ); + if ( is_multisite() ) { + $blog_details = get_blog_details(); + $site_path = $blog_details->path . 'wp-login.php'; + } + + $lostpassword_url = add_query_arg( $args, network_site_url( $site_path . 'wp-login.php', 'login' ) ); /** * Filters the Lost Password URL.