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:
parent
ba80e82ffb
commit
9eb8e29357
|
@ -771,16 +771,29 @@ final class WP_Theme implements ArrayAccess {
|
||||||
$this->name_translated = translate( $value, $this->get('TextDomain' ) );
|
$this->name_translated = translate( $value, $this->get('TextDomain' ) );
|
||||||
return $this->name_translated;
|
return $this->name_translated;
|
||||||
case 'Tags' :
|
case 'Tags' :
|
||||||
if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) )
|
if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {
|
||||||
return $value;
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
static $tags_list;
|
static $tags_list;
|
||||||
if ( ! isset( $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
|
$feature_list = get_theme_feature_list( false ); // No API
|
||||||
foreach ( $feature_list as $tags )
|
foreach ( $feature_list as $tags ) {
|
||||||
$tags_list += $tags;
|
$tags_list += $tags;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( $value as &$tag ) {
|
foreach ( $value as &$tag ) {
|
||||||
if ( isset( $tags_list[ $tag ] ) ) {
|
if ( isset( $tags_list[ $tag ] ) ) {
|
||||||
|
|
Loading…
Reference in New Issue