Make WordPress Core


Ignore:
Timestamp:
02/26/2021 12:50:46 AM (4 years ago)
Author:
peterwilsoncc
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.
Fixes #52605. See #34281.

File:
1 edited

Legend:

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

    r50422 r50439  
    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.