From 720106e16da92a7a8dddd01bd55188c19ca6d35b Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Mon, 4 Jul 2016 09:58:28 +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. Built from https://develop.svn.wordpress.org/trunk@37946 git-svn-id: http://core.svn.wordpress.org/trunk@37887 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme.php | 19 ++++++++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index fc1bf91a78..e65ec431ff 100644 --- a/wp-includes/class-wp-theme.php +++ b/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 ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index a939e4adc1..c12887c0cb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.