From 9eb8e29357c88945e5f5ad4f958af65db527bd3b Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 4 Jul 2016 09:57:37 +0000 Subject: [PATCH] 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 --- src/wp-includes/class-wp-theme.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index fc1bf91a78..e65ec431ff 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -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 ) {