Make WordPress Core


Ignore:
Timestamp:
02/15/2023 11:35:33 PM (16 months ago)
Author:
SergeyBiryukov
Message:

I18N: Check that $wp_locale global is set before calling its methods.

This avoids a fatal error if these functions are called in a mu-plugin before $wp_locale is set:

  • wp_get_list_item_separator()
  • wp_get_word_count_type()

Follow-up to [52929], [52933], [55279], [55295].

Props kraftbj.
Fixes #56698.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-locale.php

    r55295 r55351  
    236236        $this->number_format['decimal_point'] = ( 'number_format_decimal_point' === $decimal_point ) ? '.' : $decimal_point;
    237237
    238         /* translators: used between list items, there is a space after the comma */
     238        /* translators: Used between list items, there is a space after the comma. */
    239239        $this->list_item_separator = __( ', ' );
    240240
Note: See TracChangeset for help on using the changeset viewer.