From 7afa6c2057e91a69067233aed2faa022025bce10 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 24 May 2019 01:32:19 +0000 Subject: [PATCH] Login and Registration: Pass the action to `site_url()` in `wp_logout_url()` and `wp_lostpassword_url()`: * Make `site_url` filter in `wp_logout_url()` aware of the `logout` action. * Make `network_site_url` filter in `wp_lostpassword_url()` aware of the `lostpassword` action. Props jfarthing84. Fixes #43407. git-svn-id: https://develop.svn.wordpress.org/trunk@45398 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/general-template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 1cb071bcc5..0ec7336452 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -352,12 +352,12 @@ function wp_loginout( $redirect = '', $echo = true ) { * @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url(). */ function wp_logout_url( $redirect = '' ) { - $args = array( 'action' => 'logout' ); + $args = array(); if ( ! empty( $redirect ) ) { $args['redirect_to'] = urlencode( $redirect ); } - $logout_url = add_query_arg( $args, site_url( 'wp-login.php', 'login' ) ); + $logout_url = add_query_arg( $args, site_url( 'wp-login.php?action=logout', 'login' ) ); $logout_url = wp_nonce_url( $logout_url, 'log-out' ); /** @@ -558,12 +558,12 @@ function wp_login_form( $args = array() ) { * @return string Lost password URL. */ function wp_lostpassword_url( $redirect = '' ) { - $args = array( 'action' => 'lostpassword' ); + $args = array(); if ( ! empty( $redirect ) ) { $args['redirect_to'] = urlencode( $redirect ); } - $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login' ) ); + $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) ); /** * Filters the Lost Password URL.