From 1e16e5eee8c76a79cc79099fed5c7b4bf663448d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 2 Oct 2017 23:20:12 +0000 Subject: [PATCH] I18N: Allow the login screen language to be specified via a `wp_lang` query variable, and use this for the interim login modal. This allows users who are using the admin area in a language other than the site language to read the notice on the login screen (which explains that they need to log in again) in their chosen language. Props Nikschavan, swissspidy Fixes #40205 git-svn-id: https://develop.svn.wordpress.org/trunk@41692 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 6 +++++- src/wp-login.php | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 01d8a88bb4..c00e34da9d 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -5342,8 +5342,12 @@ function wp_auth_check_html() { '1', + 'wp_lang' => get_user_locale(), + ), $login_url ); ?> -
+
HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure ); + if ( $switched_locale ) { + restore_previous_locale(); + } + wp_safe_redirect( wp_get_referer() ); exit(); @@ -501,6 +509,10 @@ case 'logout' : $requested_redirect_to = ''; } + if ( $switched_locale ) { + restore_previous_locale(); + } + /** * Filters the log out redirect URL. * @@ -589,6 +601,11 @@ endif;