WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/28/2016 11:52:45 AM (4 years ago)
Author:
ocean90
Message:

I18N: Move the WP_Locale class to its own file.

The new class-wp-locale.php file is loaded in locale.php for backward compatibility purposes.

See #26511.
Fixes #37209.

File:
1 copied

Legend:

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

    r37886 r37889  
    11<?php
    22/**
    3  * Date and Time Locale object
     3 * Locale API: WP_Locale class
    44 *
    55 * @package WordPress
    66 * @subpackage i18n
     7 * @since 4.6.0
    78 */
    89
    910/**
    10  * Class that loads the calendar locale.
     11 * Core class used to store translated data for a locale.
    1112 *
    1213 * @since 2.1.0
     14 * @since 4.6.0 Moved to its own file from wp-includes/locale.php.
    1315 */
    1416class WP_Locale {
     
    9496     */
    9597    public $number_format;
     98
     99    /**
     100     * Constructor which calls helper methods to set up object variables.
     101     *
     102     * @since 2.1.0
     103     */
     104    public function __construct() {
     105        $this->init();
     106        $this->register_globals();
     107    }
    96108
    97109    /**
     
    357369
    358370    /**
    359      * Constructor which calls helper methods to set up object variables
    360      *
    361      * @since 2.1.0
    362      */
    363     public function __construct() {
    364         $this->init();
    365         $this->register_globals();
    366     }
    367 
    368     /**
    369371     * Checks if current locale is RTL.
    370372     *
     
    394396    }
    395397}
    396 
    397 /**
    398  * Checks if current locale is RTL.
    399  *
    400  * @since 3.0.0
    401  *
    402  * @global WP_Locale $wp_locale
    403  *
    404  * @return bool Whether locale is RTL.
    405  */
    406 function is_rtl() {
    407     global $wp_locale;
    408     return $wp_locale->is_rtl();
    409 }
Note: See TracChangeset for help on using the changeset viewer.