WordPress.org

Make WordPress Core

Changeset 45398


Ignore:
Timestamp:
05/24/2019 01:32:19 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/general-template.php

    r45380 r45398  
    353353 */
    354354function wp_logout_url( $redirect = '' ) {
    355     $args = array( 'action' => 'logout' );
     355    $args = array();
    356356    if ( ! empty( $redirect ) ) {
    357357        $args['redirect_to'] = urlencode( $redirect );
    358358    }
    359359
    360     $logout_url = add_query_arg( $args, site_url( 'wp-login.php', 'login' ) );
     360    $logout_url = add_query_arg( $args, site_url( 'wp-login.php?action=logout', 'login' ) );
    361361    $logout_url = wp_nonce_url( $logout_url, 'log-out' );
    362362
     
    559559 */
    560560function wp_lostpassword_url( $redirect = '' ) {
    561     $args = array( 'action' => 'lostpassword' );
     561    $args = array();
    562562    if ( ! empty( $redirect ) ) {
    563563        $args['redirect_to'] = urlencode( $redirect );
    564564    }
    565565
    566     $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php', 'login' ) );
     566    $lostpassword_url = add_query_arg( $args, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
    567567
    568568    /**
Note: See TracChangeset for help on using the changeset viewer.