WordPress.org

Make WordPress Core

Ticket #14553: 14553.diff

File 14553.diff, 1.4 KB (added by nacin, 8 years ago)

Adding an arg to get_locale()

  • wp-includes/update.php

     
    3333                $current->version_checked = $wp_version;
    3434        }
    3535
    36         $locale = apply_filters( 'core_version_check_locale', get_locale() );
     36        $locale = apply_filters( 'core_version_check_locale', get_locale( true ) );
    3737
    3838        // Update last_checked for current to prevent multiple blocking requests if request hangs
    3939        $current->last_checked = time();
  • wp-includes/l10n.php

     
    2323 * @uses apply_filters() Calls 'locale' hook on locale value.
    2424 * @uses $locale Gets the locale stored in the global.
    2525 *
     26 * @param bool $network Whether to retrieve the network wide setting when running
     27 *      multisite. Optional, default false.
    2628 * @return string The locale of the blog or from the 'locale' hook.
    2729 */
    28 function get_locale() {
     30function get_locale( $network = false ) {
    2931        global $locale;
    3032
    3133        if ( isset( $locale ) )
     
    3739
    3840        // If multisite, check options.
    3941        if ( is_multisite() && !defined('WP_INSTALLING') ) {
    40                 $ms_locale = get_option('WPLANG');
    41                 if ( $ms_locale === false )
     42                if ( $network || false === get_option('WPLANG') )
    4243                        $ms_locale = get_site_option('WPLANG');
    4344
    4445                if ( $ms_locale !== false )