diff --git src/wp-admin/css/themes.css src/wp-admin/css/themes.css
index 79247ad..1814884 100644
|
|
|
259 | 259 | box-shadow: inset 0 1px 1px rgba(0,0,0,0.5); |
260 | 260 | } |
261 | 261 | |
| 262 | .theme-browser .customize-control .theme.active .theme-name { |
| 263 | padding-right: 15px; |
| 264 | } |
| 265 | |
262 | 266 | .theme-browser .theme.active .theme-name span { |
263 | 267 | font-weight: 600; |
264 | 268 | } |
diff --git src/wp-includes/class-wp-customize-control.php src/wp-includes/class-wp-customize-control.php
index 4ac0bef..bf17fb2 100644
|
|
class WP_Customize_Theme_Control extends WP_Customize_Control { |
1243 | 1243 | */ |
1244 | 1244 | public function content_template() { |
1245 | 1245 | $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); |
| 1246 | $active_url = esc_url( remove_query_arg( 'theme', $current_url ) ); |
1246 | 1247 | $preview_url = esc_url( add_query_arg( 'theme', '__THEME__', $current_url ) ); // Token because esc_url() strips curly braces. |
1247 | 1248 | $preview_url = str_replace( '__THEME__', '{{ data.theme.id }}', $preview_url ); |
1248 | 1249 | ?> |
1249 | | <div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name"> |
| 1250 | <# if ( data.theme.isActiveTheme ) { #> |
| 1251 | <div class="theme active" tabindex="0" data-preview-url="<?php echo esc_attr( $active_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name"> |
| 1252 | <# } else { #> |
| 1253 | <div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name"> |
| 1254 | <# } #> |
| 1255 | |
1250 | 1256 | <# if ( data.theme.screenshot[0] ) { #> |
1251 | 1257 | <div class="theme-screenshot"> |
1252 | 1258 | <img data-src="{{ data.theme.screenshot[0] }}" alt="" /> |
… |
… |
class WP_Customize_Theme_Control extends WP_Customize_Control { |
1254 | 1260 | <# } else { #> |
1255 | 1261 | <div class="theme-screenshot blank"></div> |
1256 | 1262 | <# } #> |
1257 | | <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Live Preview' ); ?></span> |
1258 | | <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.theme.author }}' ); ?></div> |
1259 | 1263 | |
1260 | | <h3 class="theme-name" id="{{ data.theme.id }}-name">{{ data.theme.name }}</h3> |
| 1264 | <# if ( data.theme.isActiveTheme ) { #> |
| 1265 | <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Customize' ); ?></span> |
| 1266 | <# } else { #> |
| 1267 | <span class="more-details" id="{{ data.theme.id }}-action"><?php _e( 'Live Preview' ); ?></span> |
| 1268 | <# } #> |
1261 | 1269 | |
1262 | | <div class="theme-actions"> |
1263 | | <button type="button" class="button theme-details"><?php _e( 'Theme Details' ); ?></button> |
1264 | | </div> |
| 1270 | <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.theme.author }}' ); ?></div> |
| 1271 | |
| 1272 | <# if ( data.theme.isActiveTheme ) { #> |
| 1273 | <h3 class="theme-name" id="{{ data.theme.id }}-name"> |
| 1274 | <?php |
| 1275 | /* translators: %s: theme name */ |
| 1276 | printf( __( '<span>Active:</span> %s' ), '{{ data.theme.name }}' ); |
| 1277 | ?> |
| 1278 | </h3> |
| 1279 | <# } else { #> |
| 1280 | <h3 class="theme-name" id="{{ data.theme.id }}-name">{{ data.theme.name }}</h3> |
| 1281 | <div class="theme-actions"> |
| 1282 | <button type="button" class="button theme-details"><?php _e( 'Theme Details' ); ?></button> |
| 1283 | </div> |
| 1284 | <# } #> |
1265 | 1285 | </div> |
1266 | 1286 | <?php |
1267 | 1287 | } |
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index 9fadd74..9eeace1 100644
|
|
final class WP_Customize_Manager { |
1198 | 1198 | require_once( ABSPATH . 'wp-admin/includes/theme.php' ); |
1199 | 1199 | |
1200 | 1200 | // Theme Controls. |
| 1201 | |
| 1202 | if ( ! $this->is_theme_active() ) { |
| 1203 | /* |
| 1204 | * Add a control for the active/original theme. |
| 1205 | * The first array element of wp_prepare_themes_for_js() is empty, |
| 1206 | * because it's reserved for the current theme. But we want |
| 1207 | * prepared data for just one theme... |
| 1208 | */ |
| 1209 | $active_theme = current( array_filter( wp_prepare_themes_for_js( array( wp_get_theme( $this->original_stylesheet ) ) ) ) ); |
| 1210 | $active_theme['isActiveTheme'] = true; |
| 1211 | $this->add_control( new WP_Customize_Theme_Control( $this, $active_theme['id'], array( |
| 1212 | 'theme' => $active_theme, |
| 1213 | 'section' => 'themes', |
| 1214 | 'settings' => 'active_theme', |
| 1215 | ) ) ); |
| 1216 | } |
| 1217 | |
1201 | 1218 | $themes = wp_prepare_themes_for_js(); |
1202 | 1219 | foreach ( $themes as $theme ) { |
1203 | | if ( $theme['active'] ) { |
| 1220 | if ( $theme['active'] || $theme['id'] === $this->original_stylesheet ) { |
1204 | 1221 | continue; |
1205 | 1222 | } |
1206 | 1223 | |
1207 | 1224 | $theme_id = 'theme_' . $theme['id']; |
| 1225 | $theme['isActiveTheme'] = false; |
1208 | 1226 | $this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array( |
1209 | 1227 | 'theme' => $theme, |
1210 | 1228 | 'section' => 'themes', |