Commit b7c085dd65 for wordpress.org
commit b7c085dd6595c6a882c1ff96c26ceb5ec58372de
Author: johnbillion <johnbillion@git.wordpress.org>
Date: Mon Nov 23 10:52:54 2026 +0000
Application Passwords: Send the created notification in the user's locale.
This ensures the receipient sees the notification in their chosen language when a password is added by a user that uses a different language.
Developed in https://github.com/WordPress/wordpress-develop/pull/16065
Props mukesh27, peterwilsoncc.
Fixes #63927
Built from https://develop.svn.wordpress.org/trunk@65740
git-svn-id: http://core.svn.wordpress.org/trunk@64770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index d9927baffb..59d91815d1 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -9641,6 +9641,8 @@ function wp_application_password_created_notification( $user_id, $new_item ) {
return;
}
+ $switched_locale = switch_to_user_locale( $user->ID );
+
/* translators: Do not translate USERNAME, APPLICATION_PASSWORD_NAME, ADMIN_EMAIL, SITENAME, SITEURL, EMAIL: those are placeholders. */
$application_password_create_text = __(
'Hi ###USERNAME###,
@@ -9724,4 +9726,8 @@ All at ###SITENAME###
$email['message'],
$email['headers']
);
+
+ if ( $switched_locale ) {
+ restore_previous_locale();
+ }
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 6b116df583..3ec0530bda 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-RC2-65739';
+$wp_version = '7.2-RC2-65740';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.