From f9a5f5485d262f623a175e6a5297b47336d53674 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 2 Oct 2017 23:21:47 +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 Built from https://develop.svn.wordpress.org/trunk@41692 git-svn-id: http://core.svn.wordpress.org/trunk@41526 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 +++++- wp-includes/version.php | 2 +- wp-login.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 01d8a88bb4..c00e34da9d 100644 --- a/wp-includes/functions.php +++ b/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;