Make WordPress Core

Ticket #31553: functions.diff

File functions.diff, 817 bytes (added by pauldewouters, 11 years ago)
  • wp-includes/functions.php

    diff --git wp-includes/functions.php wp-includes/functions.php
    index bbc11c5..ec3cb0d 100644
    function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { 
    167167 */
    168168function number_format_i18n( $number, $decimals = 0 ) {
    169169        global $wp_locale;
    170         $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
     170
     171        if ( ! is_object( $wp_locale ) ) {
     172                $formatted = number_format( $number, absint( $decimals ) );
     173        } else {
     174                $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
     175        }
    171176
    172177        /**
    173178         * Filter the number formatted based on the locale.