Make WordPress Core

Changeset 37946


Ignore:
Timestamp:
07/04/2016 09:57:37 AM (10 years ago)
Author:
ocean90
Message:

Themes: After [37287], add deprecated theme features to the tag list in WP_Theme::translate_header().

Themes which are not yet updated can still have the old tags. This makes sure that these tags are still translated.

See #33407.

File:
1 edited

Legend:

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

    r37539 r37946  
    772772                                return $this->name_translated;
    773773                        case 'Tags' :
    774                                 if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) )
     774                                if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {
    775775                                        return $value;
     776                                }
    776777
    777778                                static $tags_list;
    778779                                if ( ! isset( $tags_list ) ) {
    779                                         $tags_list = array();
     780                                        $tags_list = array(
     781                                                // As of 4.6, deprecated tags which are only used to provide translation for older themes.
     782                                                'black' => __( 'Black' ), 'blue' => __( 'Blue' ), 'brown'  => __( 'Brown' ),
     783                                                'gray' => __( 'Gray' ), 'green'  => __( 'Green' ), 'orange' => __( 'Orange' ),
     784                                                'pink' => __( 'Pink' ), 'purple' => __( 'Purple' ), 'red' => __( 'Red' ),
     785                                                'silver' => __( 'Silver' ), 'tan' => __( 'Tan' ), 'white' => __( 'White' ),
     786                                                'yellow' => __( 'Yellow' ), 'dark' => __( 'Dark' ), 'light' => __( 'Light' ),
     787                                                'fixed-layout' => __( 'Fixed Layout' ), 'fluid-layout' => __( 'Fluid Layout' ),
     788                                                'responsive-layout' => __( 'Responsive Layout' ), 'blavatar' => __( 'Blavatar' ),
     789                                                'photoblogging' => __( 'Photoblogging' ), 'seasonal' => __( 'Seasonal' ),
     790                                        );
     791
    780792                                        $feature_list = get_theme_feature_list( false ); // No API
    781                                         foreach ( $feature_list as $tags )
     793                                        foreach ( $feature_list as $tags ) {
    782794                                                $tags_list += $tags;
     795                                        }
    783796                                }
    784797
Note: See TracChangeset for help on using the changeset viewer.