Login and Registration: Link to the correct site after activating a user on a Multisite install in subdirectory mode.

Props pkarjala, Mista-Flo, tmoore41, Ipstenu, ksoares, mukesh27, whyisjake.
Fixes #39311.

git-svn-id: https://develop.svn.wordpress.org/trunk@48672 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-07-28 17:18:06 +00:00
parent 0dd3bd3b8b
commit 087d11282a
2 changed files with 18 additions and 7 deletions

View File

@@ -605,12 +605,17 @@ function wp_login_form( $args = array() ) {
* @return string Lost password URL.
*/
function wp_lostpassword_url( $redirect = '' ) {
$args = array();
$args = array(
'action' => 'lostpassword',
);
if ( ! empty( $redirect ) ) {
$args['redirect_to'] = urlencode( $redirect );
}
$lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
$blog_details = get_blog_details();
$lostpassword_url = add_query_arg( $args, network_site_url( $blog_details->path . 'wp-login.php', 'login' ) );
/**
* Filters the Lost Password URL.