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.

git-svn-id: https://develop.svn.wordpress.org/trunk@37946 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling 2016-07-04 09:57:37 +00:00
parent ba80e82ffb
commit 9eb8e29357
1 changed files with 16 additions and 3 deletions

View File

@ -771,15 +771,28 @@ final class WP_Theme implements ArrayAccess {
$this->name_translated = translate( $value, $this->get('TextDomain' ) );
return $this->name_translated;
case 'Tags' :
if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) )
if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {
return $value;
}
static $tags_list;
if ( ! isset( $tags_list ) ) {
$tags_list = array();
$tags_list = array(
// As of 4.6, deprecated tags which are only used to provide translation for older themes.
'black' => __( 'Black' ), 'blue' => __( 'Blue' ), 'brown' => __( 'Brown' ),
'gray' => __( 'Gray' ), 'green' => __( 'Green' ), 'orange' => __( 'Orange' ),
'pink' => __( 'Pink' ), 'purple' => __( 'Purple' ), 'red' => __( 'Red' ),
'silver' => __( 'Silver' ), 'tan' => __( 'Tan' ), 'white' => __( 'White' ),
'yellow' => __( 'Yellow' ), 'dark' => __( 'Dark' ), 'light' => __( 'Light' ),
'fixed-layout' => __( 'Fixed Layout' ), 'fluid-layout' => __( 'Fluid Layout' ),
'responsive-layout' => __( 'Responsive Layout' ), 'blavatar' => __( 'Blavatar' ),
'photoblogging' => __( 'Photoblogging' ), 'seasonal' => __( 'Seasonal' ),
);
$feature_list = get_theme_feature_list( false ); // No API
foreach ( $feature_list as $tags )
foreach ( $feature_list as $tags ) {
$tags_list += $tags;
}
}
foreach ( $value as &$tag ) {