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.
Built from https://develop.svn.wordpress.org/trunk@37946


git-svn-id: http://core.svn.wordpress.org/trunk@37887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-07-04 09:58:28 +00:00
parent b733aa79ab
commit 720106e16d
2 changed files with 17 additions and 4 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 ) {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-beta1-37945';
$wp_version = '4.6-beta1-37946';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.