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. Built from https://develop.svn.wordpress.org/branches/5.7@50440 git-svn-id: http://core.svn.wordpress.org/branches/5.7@50051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6072eb4497
commit
fea7422a14
|
@ -2749,6 +2749,11 @@ function retrieve_password( $user_login = null ) {
|
|||
return $key;
|
||||
}
|
||||
|
||||
// Localize password reset message content for user.
|
||||
$locale = get_user_locale( $user_data );
|
||||
|
||||
$switched_locale = switch_to_locale( $locale );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
$site_name = get_network()->site_name;
|
||||
} else {
|
||||
|
@ -2759,11 +2764,6 @@ function retrieve_password( $user_login = null ) {
|
|||
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
||||
}
|
||||
|
||||
// Localize password reset message content for user.
|
||||
$locale = get_user_locale( $user_data );
|
||||
|
||||
$switched_locale = switch_to_locale( $locale );
|
||||
|
||||
$message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
|
||||
/* translators: %s: Site name. */
|
||||
$message .= sprintf( __( 'Site Name: %s' ), $site_name ) . "\r\n\r\n";
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.7-RC1-50438';
|
||||
$wp_version = '5.7-RC1-50440';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue