Make WordPress Core

Changeset 54803 for trunk


Ignore:
Timestamp:
11/11/2022 01:25:30 AM (2 years ago)
Author:
peterwilsoncc
Message:

I18N: Initialize textdomain registry in wp_load_translations_early().

Initialize WP_Textdomain_Registry in wp_load_translations_early(). This ensures the global $wp_textdomain_registry is set up prior to loading the translations.

Props azurseisme, TimothyBlynJacobs, costdev, ocean90, flixos90, swissspidy.
Fixes #57051.

File:
1 edited

Legend:

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

    r54797 r54803  
    13221322 * @access private
    13231323 *
     1324 * @global WP_Textdomain_Registry $wp_textdomain_registry WordPress Textdomain Registry.
    13241325 * @global WP_Locale $wp_locale WordPress date and time locale object.
    13251326 */
    13261327function wp_load_translations_early() {
    1327     global $wp_locale;
     1328    global $wp_locale, $wp_textdomain_registry;
    13281329
    13291330    static $loaded = false;
     
    13431344    require_once ABSPATH . WPINC . '/pomo/mo.php';
    13441345    require_once ABSPATH . WPINC . '/l10n.php';
     1346    require_once ABSPATH . WPINC . '/class-wp-textdomain-registry.php';
    13451347    require_once ABSPATH . WPINC . '/class-wp-locale.php';
    13461348    require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php';
     
    13511353    $locales   = array();
    13521354    $locations = array();
     1355
     1356    if ( ! $wp_textdomain_registry instanceof WP_Textdomain_Registry ) {
     1357        $wp_textdomain_registry = new WP_Textdomain_Registry();
     1358    }
    13531359
    13541360    while ( true ) {
Note: See TracChangeset for help on using the changeset viewer.