Make WordPress Core

Changeset 50440


Ignore:
Timestamp:
02/26/2021 11:15:54 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Users: Use localized site title for password reset emails.

When sending password reset emails, switch to the user's locale prior to obtaining the site title to allow for plugins filtering based on locale.

Follow up to [50129,50139-50141,50152,50415].

Props chouby.
Merges [50439] to the 5.7 branch.
Fixes #52605. See #34281.

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/src/wp-includes/user.php

    r50422 r50440  
    27502750    }
    27512751
     2752    // Localize password reset message content for user.
     2753    $locale = get_user_locale( $user_data );
     2754
     2755    $switched_locale = switch_to_locale( $locale );
     2756
    27522757    if ( is_multisite() ) {
    27532758        $site_name = get_network()->site_name;
     
    27592764        $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    27602765    }
    2761 
    2762     // Localize password reset message content for user.
    2763     $locale = get_user_locale( $user_data );
    2764 
    2765     $switched_locale = switch_to_locale( $locale );
    27662766
    27672767    $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
Note: See TracChangeset for help on using the changeset viewer.