From efed19d3dffb44a23fd9f4b1d5878f680610edb6 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 6 Dec 2013 14:36:07 +0000 Subject: [PATCH] Map old -width theme tags to new -layout tags for the purposes of translation in the admin. see #21442. git-svn-id: https://develop.svn.wordpress.org/trunk@26725 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/wp-admin.css | 1 - src/wp-admin/themes.php | 5 +---- src/wp-includes/class-wp-theme.php | 13 ++++++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/css/wp-admin.css b/src/wp-admin/css/wp-admin.css index 28c56f4bfd..698c5ef9f0 100644 --- a/src/wp-admin/css/wp-admin.css +++ b/src/wp-admin/css/wp-admin.css @@ -7006,7 +7006,6 @@ body.folded .theme-overlay .theme-wrap { font-weight: 400; margin: 30px 0 0 0; padding-top: 20px; - text-transform: capitalize; } .theme-overlay .theme-tags span { diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 94abb8d545..2351b84dab 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -289,10 +289,7 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_ <# } #> <# if ( data.tags ) { #> -

- - {{{ data.tags.replace( /-/g, ' ' ) }}} -

+

{{{ data.tags }}}

<# } #> diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php index ba075551ec..511699adce 100644 --- a/src/wp-includes/class-wp-theme.php +++ b/src/wp-includes/class-wp-theme.php @@ -46,6 +46,14 @@ final class WP_Theme implements ArrayAccess { 'twentyfourteen' => 'Twenty Fourteen', ); + /** + * Renamed theme tags. + */ + private static $tag_map = array( + 'fixed-width' => 'fixed-layout', + 'flexible-width' => 'fluid-layout', + ); + /** * Absolute path to the theme root, usually wp-content/themes * @@ -706,8 +714,11 @@ final class WP_Theme implements ArrayAccess { } foreach ( $value as &$tag ) { - if ( isset( $tags_list[ $tag ] ) ) + if ( isset( $tags_list[ $tag ] ) ) { $tag = $tags_list[ $tag ]; + } elseif ( isset( self::$tag_map[ $tag ] ) ) { + $tag = $tags_list[ self::$tag_map[ $tag ] ]; + } } return $value;