I18N: Don't use get_user_option() for retrieving user's language.

`get_user_option()` checks for both option types, site and network. Since `locale` is only a network option we can directly access the field via `WP_User`s magic getter.

Props johnjamesjacoby.
Fixes #38578.
Built from https://develop.svn.wordpress.org/trunk@39040


git-svn-id: http://core.svn.wordpress.org/trunk@38982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-10-30 22:26:31 +00:00
parent cf571b12c1
commit ba9b3cf6a6
2 changed files with 3 additions and 3 deletions

View File

@ -281,9 +281,9 @@ if ( $languages ) : ?>
</th>
<td>
<?php
$user_locale = get_user_option( 'locale', $profileuser->ID );
$user_locale = $profileuser->locale;
if ( 'en_US' === $user_locale ) { // en_US
if ( 'en_US' === $user_locale ) {
$user_locale = false;
} elseif ( ! in_array( $user_locale, $languages, true ) ) {
$user_locale = get_locale();

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-beta1-39039';
$wp_version = '4.7-beta1-39040';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.