mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
In number_format_i18n(), check if $wp_locale is set before using it.
Props pauldewouters. Fixes #31553. git-svn-id: https://develop.svn.wordpress.org/trunk@35092 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e85d9f1312
commit
34a716709c
@ -171,7 +171,12 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
|
||||
*/
|
||||
function number_format_i18n( $number, $decimals = 0 ) {
|
||||
global $wp_locale;
|
||||
$formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
|
||||
|
||||
if ( isset( $wp_locale ) ) {
|
||||
$formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
|
||||
} else {
|
||||
$formatted = number_format( $number, absint( $decimals ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the number formatted based on the locale.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user