WordPress.org

Making WordPress.org

Changeset 4028


Ignore:
Timestamp:
09/11/2016 02:50:40 PM (4 years ago)
Author:
ocean90
Message:

Rosetta: Add domain and path properties to Site objects.

See #2003.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-global-wordpress-org.php

    r4027 r4028  
    55
    66class Global_WordPress_Org implements Site {
     7
     8    /**
     9     * Domain of this site.
     10     *
     11     * @var string
     12     */
     13    public static $domain = 'global.wordpress.org';
     14
     15    /**
     16     * Path of this site.
     17     *
     18     * @var string
     19     */
     20    public static $path = '/';
    721
    822    /**
     
    1428     */
    1529    public static function test( WP_Site $site ) {
    16         if ( 'global.wordpress.org' === $site->domain ) {
     30        if ( self::$domain === $site->domain ) {
    1731            return true;
    1832        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-main.php

    r4027 r4028  
    55
    66class Locale_Main implements Site {
     7
     8    /**
     9     * Domain of this site.
     10     *
     11     * @var string
     12     */
     13    public static $domain = '#[a-z-]{2,5}\.wordpress\.org#';
     14
     15    /**
     16     * Path of this site.
     17     *
     18     * @var string
     19     */
     20    public static $path = '/';
    721
    822    /**
     
    1428     */
    1529    public static function test( WP_Site $site ) {
    16         if ( '/' === $site->path ) {
     30        if ( self::$path === $site->path ) {
    1731            return true;
    1832        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-support.php

    r4027 r4028  
    55
    66class Locale_Support implements Site {
     7
     8    /**
     9     * Domain of this site.
     10     *
     11     * @var string
     12     */
     13    public static $domain = '#[a-z-]{2,5}\.wordpress\.org#';
     14
     15    /**
     16     * Path of this site.
     17     *
     18     * @var string
     19     */
     20    public static $path = '/support/';
    721
    822    /**
     
    1428     */
    1529    public static function test( WP_Site $site ) {
    16         if ( '/support/' === $site->path ) {
     30        if ( self::$path === $site->path ) {
    1731            return true;
    1832        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-locale-team.php

    r4027 r4028  
    55
    66class Locale_Team implements Site {
     7
     8    /**
     9     * Domain of this site.
     10     *
     11     * @var string
     12     */
     13    public static $domain = '#[a-z-]{2,5}\.wordpress\.org#';
     14
     15    /**
     16     * Path of this site.
     17     *
     18     * @var string
     19     */
     20    public static $path = '/team/';
    721
    822    /**
     
    1428     */
    1529    public static function test( WP_Site $site ) {
    16         if ( '/team/' === $site->path ) {
     30        if ( self::$path === $site->path ) {
    1731            return true;
    1832        }
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/rosetta/inc/site/class-translate-wordpress-org.php

    r4027 r4028  
    55
    66class Translate_WordPress_Org implements Site {
     7
     8    /**
     9     * Domain of this site.
     10     *
     11     * @var string
     12     */
     13    public static $domain = 'translate.wordpress.org';
     14
     15    /**
     16     * Path of this site.
     17     *
     18     * @var string
     19     */
     20    public static $path = '/';
    721
    822    /**
     
    1428     */
    1529    public static function test( WP_Site $site ) {
    16         if ( 'translate.wordpress.org' === $site->domain ) {
     30        if ( self::$domain === $site->domain ) {
    1731            return true;
    1832        }
Note: See TracChangeset for help on using the changeset viewer.