Skip to content

Commit 30ac54b

Browse files
committed
I18N: add a class_exists conditional before attempting NumberFormatter construction
1 parent fd1c0e2 commit 30ac54b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function wp_date( $format, $timestamp = null, $timezone = null ) {
290290
break;
291291
case 'S':
292292
// NumberFormatter can localize and format input numbers, producing results with ordinal suffixes
293-
if ( 'j' === $prev ) {
293+
if ( 'j' === $prev && class_exists('NumberFormatter') ) {
294294
$ordinal_formatter = new \NumberFormatter( get_user_locale(), \NumberFormatter::ORDINAL );
295295
$ordinal_day = $ordinal_formatter->format( (int) $datetime->format( 'j' ) );
296296
$new_format = substr( $new_format, 0, -1 ) . addcslashes( $ordinal_day, '\\A..Za..z' );

0 commit comments

Comments
 (0)