Make WordPress Core

Changeset 38364


Ignore:
Timestamp:
08/26/2016 10:19:26 AM (9 years ago)
Author:
wonderboymusic
Message:

i18n: move is_rtl() to l10n.php (which loads way earlier). Load WP_Locale file in wp-settings.php. Retire wp-includes/locale.php - it only loaded the class and the one function, is_rtl(). If someone loaded this file for fun somewhere else, it would be a fatal error.

See #37827.

Location:
trunk/src
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/update-core.php

    r38242 r38364  
    706706// 4.6
    707707'wp-admin/includes/class-wp-automatic-upgrader.php', // Wrong file name, see #37628.
     708// 4.7
     709'wp-includes/locale.php',
    708710);
    709711
  • trunk/src/wp-includes/l10n.php

    r38360 r38364  
    11331133    return $output;
    11341134}
     1135
     1136/**
     1137 * Checks if current locale is RTL.
     1138 *
     1139 * @since 3.0.0
     1140 *
     1141 * @global WP_Locale $wp_locale
     1142 *
     1143 * @return bool Whether locale is RTL.
     1144 */
     1145function is_rtl() {
     1146    global $wp_locale;
     1147    return $wp_locale->is_rtl();
     1148}
  • trunk/src/wp-settings.php

    r38362 r38364  
    214214require( ABSPATH . WPINC . '/rest-api/class-wp-rest-response.php' );
    215215require( ABSPATH . WPINC . '/rest-api/class-wp-rest-request.php' );
     216require( ABSPATH . WPINC . '/class-wp-locale.php' );
    216217
    217218$GLOBALS['wp_embed'] = new WP_Embed();
     
    374375unset( $locale_file );
    375376
    376 // Pull in locale data after loading text domain.
    377 require_once( ABSPATH . WPINC . '/locale.php' );
    378 
    379377/**
    380378 * WordPress Locale object for loading locale domain date and various strings.
Note: See TracChangeset for help on using the changeset viewer.