mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Theme Switcher: Provide an easier way to reset back to the current active theme.
* Add control for the active theme when doing a theme preview * Highlight an active theme and move it to the top props valendesigns, ocean90. fixes #32002. git-svn-id: https://develop.svn.wordpress.org/trunk@32265 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1198,13 +1198,27 @@ final class WP_Customize_Manager {
|
||||
require_once( ABSPATH . 'wp-admin/includes/theme.php' );
|
||||
|
||||
// Theme Controls.
|
||||
|
||||
// Add a control for the active/original theme.
|
||||
if ( ! $this->is_theme_active() ) {
|
||||
$themes = wp_prepare_themes_for_js( array( wp_get_theme( $this->original_stylesheet ) ) );
|
||||
$active_theme = current( $themes );
|
||||
$active_theme['isActiveTheme'] = true;
|
||||
$this->add_control( new WP_Customize_Theme_Control( $this, $active_theme['id'], array(
|
||||
'theme' => $active_theme,
|
||||
'section' => 'themes',
|
||||
'settings' => 'active_theme',
|
||||
) ) );
|
||||
}
|
||||
|
||||
$themes = wp_prepare_themes_for_js();
|
||||
foreach ( $themes as $theme ) {
|
||||
if ( $theme['active'] ) {
|
||||
if ( $theme['active'] || $theme['id'] === $this->original_stylesheet ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$theme_id = 'theme_' . $theme['id'];
|
||||
$theme['isActiveTheme'] = false;
|
||||
$this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array(
|
||||
'theme' => $theme,
|
||||
'section' => 'themes',
|
||||
|
||||
Reference in New Issue
Block a user