WordPress.org

Make WordPress Core

Changeset 39040


Ignore:
Timestamp:
10/30/2016 10:25:34 PM (4 years ago)
Author:
ocean90
Message:

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_Users magic getter.

Props johnjamesjacoby.
Fixes #38578.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r39039 r39040  
    282282    <td>
    283283        <?php
    284         $user_locale = get_user_option( 'locale', $profileuser->ID );
    285 
    286         if ( 'en_US' === $user_locale ) { // en_US
     284        $user_locale = $profileuser->locale;
     285
     286        if ( 'en_US' === $user_locale ) {
    287287            $user_locale = false;
    288288        } elseif ( ! in_array( $user_locale, $languages, true ) ) {
Note: See TracChangeset for help on using the changeset viewer.