Changeset 38705 for trunk/src/wp-includes/l10n.php
- Timestamp:
- 10/03/2016 07:03:41 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/l10n.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r38438 r38705 77 77 78 78 /** 79 * Retrieves the locale of the current user. 80 * 81 * If the user has a locale set to a non-empty string then it will be 82 * returned. Otherwise it returns the locale of get_locale(). 83 * 84 * @since 4.7.0 85 * 86 * @return string The locale of the current user. 87 */ 88 function get_user_locale() { 89 $user = wp_get_current_user(); 90 91 $locale = $user->locale; 92 return ( '' === $locale ) ? get_locale() : $locale; 93 } 94 95 /** 79 96 * Retrieve the translation of $text. 80 97 * … … 634 651 function load_default_textdomain( $locale = null ) { 635 652 if ( null === $locale ) { 636 $locale = get_locale();653 $locale = is_admin() ? get_user_locale() : get_locale(); 637 654 } 638 655
Note: See TracChangeset
for help on using the changeset viewer.