WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/23/2021 04:37:01 PM (5 months ago)
Author:
desrosj
Message:

Users: Ensure reset password emails are in the receiving user’s locale.

This ensures that reset password emails initiated by an administrator are sent to the user in their preferred locale.

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

Props chouby, davidbaumwald, audrasjb, johnbillion.
Fixes #52605. See #34281.

File:
1 edited

Legend:

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

    r50230 r50415  
    27602760    }
    27612761
     2762    // Localize password reset message content for user.
     2763    $locale = get_user_locale( $user_data );
     2764
     2765    $switched_locale = switch_to_locale( $locale );
     2766
    27622767    $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
    27632768    /* translators: %s: Site name. */
     
    28072812     */
    28082813    $message = apply_filters( 'retrieve_password_message', $message, $key, $user_login, $user_data );
     2814
     2815    if ( $switched_locale ) {
     2816        restore_previous_locale();
     2817    }
    28092818
    28102819    if ( $message && ! wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) ) {
Note: See TracChangeset for help on using the changeset viewer.