Make WordPress Core

Ticket #22834: 22834.diff

File 22834.diff, 993 bytes (added by rmarks, 12 years ago)

Based on the logic in comment:5, here is a patch. It has a logic error in that the registering of the sidebars occurs too late.

  • wp-includes/class-wp-customize-manager.php

    diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php
    index cad9f13..b581c96 100644
    a b final class WP_Customize_Manager { 
    179179                        // Handle custom theme roots.
    180180                        add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
    181181                        add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
     182            update_option( 'theme_switched', $this->theme->stylesheet );
    182183                }
    183184
    184185                do_action( 'start_previewing_theme', $this );
    final class WP_Customize_Manager { 
    209210                        // Handle custom theme roots.
    210211                        remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
    211212                        remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
     213            update_option( 'theme_switched', false );
    212214                }
    213215
    214216                do_action( 'stop_previewing_theme', $this );