Ticket #32002: 32002.1.patch
File 32002.1.patch, 2.3 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-customize-control.php
1245 1245 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 1246 1246 $preview_url = esc_url( add_query_arg( 'theme', '__THEME__', $current_url ) ); // Token because esc_url() strips curly braces. 1247 1247 $preview_url = str_replace( '__THEME__', '{{ data.theme.id }}', $preview_url ); 1248 1249 // Doesn't work, because $this->theme is empty 1250 $is_active_theme = $this->theme->stylesheet === $this->manager->original_stylesheet; 1248 1251 ?> 1249 1252 <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 1253 <# if ( data.theme.screenshot[0] ) { #> -
src/wp-includes/class-wp-customize-manager.php
33 33 * 34 34 * @var string 35 35 */ 36 p rotected$original_stylesheet;36 public $original_stylesheet; 37 37 38 38 /** 39 39 * Whether this is a Customizer pageload. … … 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 $this->add_control( new WP_Customize_Theme_Control( $this, $active_theme['id'], array( 1211 'theme' => $active_theme, 1212 'section' => 'themes', 1213 'settings' => 'active_theme', 1214 ) ) ); 1215 } 1216 1201 1217 $themes = wp_prepare_themes_for_js(); 1202 1218 foreach ( $themes as $theme ) { 1203 if ( $theme['active'] ) {1219 if ( $theme['active'] || $theme['stylesheet'] === $this->original_stylesheet ) { 1204 1220 continue; 1205 1221 } 1206 1222