<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[20852] trunk: Customize API shuffling.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/20852">20852</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-05-23 17:56:42 +0000 (Wed, 23 May 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Customize API shuffling.
 * Rename WP_Customize to WP_Customize_Manager.
 * Move customize-controls.php to wp-admin/customize.php.
 * Make customize.php the formal entry point, rather than admin.php?customize=on.
 * Rename is_current_theme_active() to is_theme_active().
 * Add getters for the theme, settings, controls, and sections properties.
 * Allow customize.php (no ?theme=) to load the active theme. Not used yet.
see <a href="http://core.trac.wordpress.org/ticket/20736">#20736</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswppluginslisttablephp">trunk/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadmincustomizephp">trunk/wp-admin/customize.php</a></li>
<li><a href="#trunkwpincludesclasswpcustomizemanagerphp">trunk/wp-includes/class-wp-customize-manager.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpincludesclasswpcustomizephp">trunk/wp-includes/class-wp-customize.php</a></li>
<li><a href="#trunkwpincludescustomizecontrolsphp">trunk/wp-includes/customize-controls.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincustomizephpfromrev20847trunkwpincludescustomizecontrolsphp"></a>
<div class="copfile"><h4>Copied: trunk/wp-admin/customize.php (from rev 20847, trunk/wp-includes/customize-controls.php) (0 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/customize.php                                (rev 0)
+++ trunk/wp-admin/customize.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -0,0 +1,149 @@
</span><ins>+&lt;?php
+/**
+ * Customize Controls
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 3.4.0
+ */
+
+require_once( './admin.php' );
+if ( ! current_user_can( 'edit_theme_options' ) )
+        die( 'Cap check failed' );
+
+global $wp_scripts, $wp_customize;
+
+if ( ! $wp_customize-&gt;is_preview() )
+        die( 'is_preview() failed' );
+
+wp_reset_vars( array( 'theme' ) );
+
+if ( ! $theme )
+        $theme = get_stylesheet();
+
+$registered = $wp_scripts-&gt;registered;
+$wp_scripts = new WP_Scripts;
+$wp_scripts-&gt;registered = $registered;
+
+add_action( 'customize_controls_print_scripts',        'print_head_scripts', 20 );
+add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts'     );
+add_action( 'customize_controls_print_styles',         'print_admin_styles', 20 );
+
+do_action( 'customize_controls_init' );
+
+wp_enqueue_script( 'customize-controls' );
+wp_enqueue_style( 'customize-controls' );
+
+do_action( 'customize_controls_enqueue_scripts' );
+
+// Let's roll.
+@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
+
+wp_user_settings();
+_wp_admin_html_begin();
+
+$admin_title = sprintf( __( '%1$s &amp;#8212; WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize-&gt;theme()-&gt;display('Name') ) ) );
+?&gt;&lt;title&gt;&lt;?php echo $admin_title; ?&gt;&lt;/title&gt;&lt;?php
+
+do_action( 'customize_controls_print_styles' );
+do_action( 'customize_controls_print_scripts' );
+?&gt;
+&lt;/head&gt;
+&lt;body class=&quot;wp-full-overlay&quot;&gt;
+        &lt;form id=&quot;customize-controls&quot; class=&quot;wrap wp-full-overlay-sidebar&quot;&gt;
+                &lt;?php wp_nonce_field( 'customize_controls' ); ?&gt;
+                &lt;div id=&quot;customize-header-actions&quot; class=&quot;wp-full-overlay-header&quot;&gt;
+                        &lt;a class=&quot;back&quot; href=&quot;&lt;?php echo esc_url( admin_url( 'themes.php' ) ); ?&gt;&quot;&gt;
+                                &lt;?php printf( __( '&amp;larr; Return to %s' ), __('Manage Themes') ); ?&gt;
+                        &lt;/a&gt;
+                &lt;/div&gt;
+
+                &lt;div class=&quot;wp-full-overlay-sidebar-content&quot;&gt;
+                        &lt;div id=&quot;customize-info&quot; class=&quot;customize-section&quot;&gt;
+                                &lt;div class=&quot;customize-section-title&quot;&gt;
+                                        &lt;span class=&quot;preview-notice&quot;&gt;&lt;?php _e('You are previewing'); ?&gt;&lt;/span&gt;
+                                        &lt;strong class=&quot;theme-name&quot;&gt;&lt;?php echo $wp_customize-&gt;theme()-&gt;display('Name'); ?&gt;&lt;/strong&gt;
+                                &lt;/div&gt;
+                                &lt;div class=&quot;customize-section-content&quot;&gt;
+                                        &lt;?php if ( $screenshot = $wp_customize-&gt;theme()-&gt;get_screenshot() ) : ?&gt;
+                                                &lt;img class=&quot;theme-screenshot&quot; src=&quot;&lt;?php echo esc_url( $screenshot ); ?&gt;&quot; /&gt;
+                                        &lt;?php endif; ?&gt;
+
+                                        &lt;?php if ( $wp_customize-&gt;theme()-&gt;get('Description') ): ?&gt;
+                                                &lt;div class=&quot;theme-description&quot;&gt;&lt;?php echo $wp_customize-&gt;theme()-&gt;display('Description'); ?&gt;&lt;/div&gt;
+                                        &lt;?php endif; ?&gt;
+                                &lt;/div&gt;
+                        &lt;/div&gt;
+
+                        &lt;div id=&quot;customize-theme-controls&quot;&gt;&lt;ul&gt;
+                                &lt;?php
+                                foreach ( $wp_customize-&gt;sections() as $section )
+                                        $section-&gt;maybe_render();
+                                ?&gt;
+                        &lt;/ul&gt;&lt;/div&gt;
+                &lt;/div&gt;
+
+                &lt;div id=&quot;customize-footer-actions&quot; class=&quot;wp-full-overlay-footer&quot;&gt;
+                        &lt;?php
+                        $save_text = $wp_customize-&gt;is_theme_active() ? __('Save') : __('Save and Activate');
+                        submit_button( $save_text, 'primary', 'save', false );
+                        ?&gt;
+                        &lt;img src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; /&gt;
+
+                        &lt;a href=&quot;#&quot; class=&quot;collapse-sidebar button-secondary&quot; title=&quot;&lt;?php esc_attr_e('Collapse Sidebar'); ?&gt;&quot;&gt;
+                                &lt;span class=&quot;collapse-sidebar-label&quot;&gt;&lt;?php _e('Collapse'); ?&gt;&lt;/span&gt;
+                                &lt;span class=&quot;collapse-sidebar-arrow&quot;&gt;&lt;/span&gt;
+                        &lt;/a&gt;
+                &lt;/div&gt;
+        &lt;/form&gt;
+        &lt;div id=&quot;customize-preview&quot; class=&quot;wp-full-overlay-main&quot;&gt;&lt;/div&gt;
+        &lt;?php
+
+        do_action( 'customize_controls_print_footer_scripts' );
+
+        // If the frontend and the admin are served from the same domain, load the
+        // preview over ssl if the customizer is being loaded over ssl. This avoids
+        // insecure content warnings. This is not attempted if the admin and frontend
+        // are on different domains to avoid the case where the frontend doesn't have
+        // ssl certs. Domain mapping plugins can force ssl in these conditions using
+        // the customize_preview_link filter.
+        $admin_origin = parse_url( admin_url() );
+        $home_origin = parse_url( home_url() );
+        $scheme = null;
+        if ( is_ssl() &amp;&amp; ( $admin_origin[ 'host' ] == $home_origin[ 'host' ] ) )
+                $scheme = 'https';
+
+        $preview_url = apply_filters( 'customize_preview_link',  home_url( '/', $scheme ) );
+
+        $settings = array(
+                'theme'    =&gt; array(
+                        'stylesheet' =&gt; $wp_customize-&gt;get_stylesheet(),
+                        'active'     =&gt; $wp_customize-&gt;is_theme_active(),
+                ),
+                'url'      =&gt; array(
+                        'preview'  =&gt; esc_url( $preview_url ),
+                        'parent'   =&gt; esc_url( admin_url() ),
+                        'ajax'     =&gt; esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
+                ),
+                'settings' =&gt; array(),
+                'controls' =&gt; array(),
+        );
+
+        foreach ( $wp_customize-&gt;settings() as $id =&gt; $setting ) {
+                $settings['settings'][ $id ] = array(
+                        'value'     =&gt; $setting-&gt;js_value(),
+                        'transport' =&gt; $setting-&gt;transport,
+                );
+        }
+
+        foreach ( $wp_customize-&gt;controls() as $id =&gt; $control ) {
+                $control-&gt;to_json();
+                $settings['controls'][ $id ] = $control-&gt;json;
+        }
+
+        ?&gt;
+        &lt;script type=&quot;text/javascript&quot;&gt;
+                var _wpCustomizeSettings = &lt;?php echo json_encode( $settings ); ?&gt;;
+        &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugins-list-table.php (20851 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugins-list-table.php        2012-05-23 15:36:27 UTC (rev 20851)
+++ trunk/wp-admin/includes/class-wp-plugins-list-table.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -69,6 +69,11 @@
</span><span class="cx">                                 $current = get_site_transient( 'update_plugins' );
</span><span class="cx">                                 foreach ( (array) $plugins['all'] as $plugin_file =&gt; $plugin_data ) {
</span><span class="cx">                                         if ( isset( $current-&gt;response[ $plugin_file ] ) ) {
</span><ins>+                                                ob_start();
+                                                var_dump( $current-&gt;response[ $plugin_file ] );
+                                                error_log( $plugin_file . ': ' . ob_get_clean() );
+                                        }
+                                        if ( ! empty( $current-&gt;response[ $plugin_file ] ) ) {
</ins><span class="cx">                                                 $plugins['all'][ $plugin_file ]['update'] = true;
</span><span class="cx">                                                 $plugins['upgrade'][ $plugin_file ] = $plugins['all'][ $plugin_file ];
</span><span class="cx">                                         }
</span></span></pre></div>
<a id="trunkwpincludesclasswpcustomizemanagerphpfromrev20847trunkwpincludesclasswpcustomizephp"></a>
<div class="copfile"><h4>Copied: trunk/wp-includes/class-wp-customize-manager.php (from rev 20847, trunk/wp-includes/class-wp-customize.php) (0 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize-manager.php                                (rev 0)
+++ trunk/wp-includes/class-wp-customize-manager.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -0,0 +1,800 @@
</span><ins>+&lt;?php
+/**
+ * Customize
+ *
+ * @package WordPress
+ * @subpackage Customize
+ * @since 3.4.0
+ */
+
+final class WP_Customize_Manager {
+        protected $theme;
+        protected $original_stylesheet;
+
+        protected $previewing = false;
+
+        protected $settings = array();
+        protected $sections = array();
+        protected $controls = array();
+
+        protected $customized;
+
+        private $_post_values;
+
+        /**
+         * Constructor.
+         *
+         * @since 3.4.0
+         */
+        public function __construct() {
+                require( ABSPATH . WPINC . '/class-wp-customize-setting.php' );
+                require( ABSPATH . WPINC . '/class-wp-customize-section.php' );
+                require( ABSPATH . WPINC . '/class-wp-customize-control.php' );
+
+                add_action( 'setup_theme',  array( $this, 'setup_theme' ) );
+                add_action( 'wp_loaded',    array( $this, 'wp_loaded' ) );
+
+                add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
+
+                add_action( 'customize_register',                 array( $this, 'register_controls' ) );
+                add_action( 'customize_controls_init',            array( $this, 'prepare_controls' ) );
+                add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );
+        }
+
+        /**
+         * Update theme modifications for the current theme.
+         * Note: Candidate core function.
+         * http://core.trac.wordpress.org/ticket/20091
+         *
+         * @since 3.4.0
+         *
+         * @param array $mods Theme modifications.
+         */
+        public function set_theme_mods( $mods ) {
+                $current = get_theme_mods();
+
+                $mods = wp_parse_args( $mods, $current );
+
+                $theme = get_stylesheet();
+                update_option( &quot;theme_mods_$theme&quot;, $mods );
+        }
+
+        /**
+         * Start preview and customize theme.
+         *
+         * Check if customize query variable exist. Init filters to filter the current theme.
+         *
+         * @since 3.4.0
+         */
+        public function setup_theme() {
+                if ( ! ( isset( $_REQUEST['customize'] ) &amp;&amp; 'on' == $_REQUEST['customize'] ) &amp;&amp; ! basename( $_SERVER['PHP_SELF'] ) == 'customize.php' )
+                        return;
+
+                send_origin_headers();
+
+                $this-&gt;start_previewing_theme();
+                show_admin_bar( false );
+        }
+
+        /**
+         * Start previewing the selected theme.
+         *
+         * Adds filters to change the current theme.
+         *
+         * @since 3.4.0
+         */
+        public function start_previewing_theme() {
+                if ( $this-&gt;is_preview() || false === $this-&gt;theme || ( $this-&gt;theme &amp;&amp; ! $this-&gt;theme-&gt;exists() ) )
+                        return;
+
+                // Initialize $theme and $original_stylesheet if they do not yet exist.
+                if ( ! isset( $this-&gt;theme ) ) {
+                        $this-&gt;theme = wp_get_theme( isset( $_REQUEST['theme'] ) ? $_REQUEST['theme'] : null );
+                        if ( ! $this-&gt;theme-&gt;exists() ) {
+                                $this-&gt;theme = false;
+                                return;
+                        }
+                }
+
+                $this-&gt;original_stylesheet = get_stylesheet();
+
+                $this-&gt;previewing = true;
+
+                add_filter( 'template', array( $this, 'get_template' ) );
+                add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
+                add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
+
+                // @link: http://core.trac.wordpress.org/ticket/20027
+                add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
+                add_filter( 'pre_option_template', array( $this, 'get_template' ) );
+
+                // Handle custom theme roots.
+                add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
+                add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
+
+                do_action( 'start_previewing_theme', $this );
+        }
+
+        /**
+         * Stop previewing the selected theme.
+         *
+         * Removes filters to change the current theme.
+         *
+         * @since 3.4.0
+         */
+        public function stop_previewing_theme() {
+                if ( ! $this-&gt;is_preview() )
+                        return;
+
+                $this-&gt;previewing = false;
+
+                remove_filter( 'template', array( $this, 'get_template' ) );
+                remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
+                remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
+
+                // @link: http://core.trac.wordpress.org/ticket/20027
+                remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
+                remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
+
+                // Handle custom theme roots.
+                remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
+                remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
+
+                do_action( 'stop_previewing_theme', $this );
+        }
+
+        /**
+         * Generic getter.
+         *
+         * @since 3.4.0
+         *
+         * @return WP_Theme
+         */
+        public function __call( $callee, $args ) {
+                if ( in_array( $callee, array( 'theme', 'settings', 'controls', 'sections' ) ) )
+                        return $this-&gt;$callee;
+        }
+
+        /**
+         * Checks if the current theme is active.
+         *
+         * @since 3.4.0
+         *
+         * @return bool
+         */
+        public function is_theme_active() {
+                return $this-&gt;get_stylesheet() == $this-&gt;original_stylesheet;
+        }
+
+        /**
+         * Register styles/scripts and initialize the preview of each setting
+         *
+         * @since 3.4.0
+         */
+        public function wp_loaded() {
+                do_action( 'customize_register', $this );
+
+                if ( $this-&gt;is_preview() &amp;&amp; ! is_admin() )
+                        $this-&gt;customize_preview_init();
+        }
+
+        /**
+         * Decode the $_POST attribute used to override the WP_Customize_Setting values.
+         *
+         * @since 3.4.0
+         */
+        public function post_value( $setting ) {
+                if ( ! isset( $this-&gt;_post_values ) ) {
+                        if ( isset( $_POST['customized'] ) )
+                                $this-&gt;_post_values = json_decode( stripslashes( $_POST['customized'] ), true );
+                        else
+                                $this-&gt;_post_values = false;
+                }
+
+                if ( isset( $this-&gt;_post_values[ $setting-&gt;id ] ) )
+                        return $setting-&gt;sanitize( $this-&gt;_post_values[ $setting-&gt;id ] );
+        }
+
+        /**
+         * Print javascript settings.
+         *
+         * @since 3.4.0
+         */
+        public function customize_preview_init() {
+                $this-&gt;prepare_controls();
+
+                wp_enqueue_script( 'customize-preview' );
+                add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
+
+                foreach ( $this-&gt;settings as $setting ) {
+                        $setting-&gt;preview();
+                }
+
+                do_action( 'customize_preview_init', $this );
+        }
+
+
+        /**
+         * Print javascript settings.
+         *
+         * @since 3.4.0
+         */
+        public function customize_preview_settings() {
+                $settings = array(
+                        'values' =&gt; array(),
+                );
+
+                foreach ( $this-&gt;settings as $id =&gt; $setting ) {
+                        $settings['values'][ $id ] = $setting-&gt;js_value();
+                }
+
+                ?&gt;
+                &lt;script type=&quot;text/javascript&quot;&gt;
+                        var _wpCustomizeSettings = &lt;?php echo json_encode( $settings ); ?&gt;;
+                &lt;/script&gt;
+                &lt;?php
+        }
+
+        /**
+         * Is it a theme preview?
+         *
+         * @since 3.4.0
+         *
+         * @return bool True if it's a preview, false if not.
+         */
+        public function is_preview() {
+                return (bool) $this-&gt;previewing;
+        }
+
+        /**
+         * Retrieve the template name of the previewed theme.
+         *
+         * @since 3.4.0
+         *
+         * @return string Template name.
+         */
+        public function get_template() {
+                return $this-&gt;theme-&gt;get_template();
+        }
+
+        /**
+         * Retrieve the stylesheet name of the previewed theme.
+         *
+         * @since 3.4.0
+         *
+         * @return string Stylesheet name.
+         */
+        public function get_stylesheet() {
+                return $this-&gt;theme-&gt;get_stylesheet();
+        }
+
+        /**
+         * Retrieve the template root of the previewed theme.
+         *
+         * @since 3.4.0
+         *
+         * @return string Theme root.
+         */
+        public function get_template_root() {
+                return get_raw_theme_root( $this-&gt;get_template(), true );
+        }
+
+        /**
+         * Retrieve the stylesheet root of the previewed theme.
+         *
+         * @since 3.4.0
+         *
+         * @return string Theme root.
+         */
+        public function get_stylesheet_root() {
+                return get_raw_theme_root( $this-&gt;get_stylesheet(), true );
+        }
+
+        /**
+         * Filter the current theme and return the name of the previewed theme.
+         *
+         * @since 3.4.0
+         *
+         * @return string Theme name.
+         */
+        public function current_theme( $current_theme ) {
+                return $this-&gt;theme-&gt;display('Name');
+        }
+
+        /**
+         * Switch the theme and trigger the save action of each setting.
+         *
+         * @since 3.4.0
+         */
+        public function save() {
+                if ( ! $this-&gt;is_preview() )
+                        die;
+
+                check_ajax_referer( 'customize_controls', 'nonce' );
+
+                // Do we have to switch themes?
+                if ( $this-&gt;get_stylesheet() != $this-&gt;original_stylesheet ) {
+                        if ( ! current_user_can( 'switch_themes' ) )
+                                die;
+
+                        // Temporarily stop previewing the theme to allow switch_themes()
+                        // to operate properly.
+                        $this-&gt;stop_previewing_theme();
+                        switch_theme( $this-&gt;get_template(), $this-&gt;get_stylesheet() );
+                        $this-&gt;start_previewing_theme();
+                }
+
+                do_action( 'customize_save', $this );
+
+                foreach ( $this-&gt;settings as $setting ) {
+                        $setting-&gt;save();
+                }
+
+                add_action( 'admin_notices', array( $this, '_save_feedback' ) );
+
+                die;
+        }
+
+        /**
+         * Show an admin notice after settings are saved.
+         *
+         * @since 3.4.0
+         */
+        public function _save_feedback() {
+                ?&gt;
+                &lt;div class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php printf( __( 'Settings saved and theme activated. &lt;a href=&quot;%s&quot;&gt;Visit site&lt;/a&gt;.' ), home_url( '/' ) ); ?&gt;&lt;/p&gt;&lt;/div&gt;
+                &lt;?php
+        }
+
+        /**
+         * Add a customize setting.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the setting. Can be a
+         *                   theme mod or option name.
+         * @param array $args Setting arguments.
+         */
+        public function add_setting( $id, $args = array() ) {
+                if ( is_a( $id, 'WP_Customize_Setting' ) )
+                        $setting = $id;
+                else
+                        $setting = new WP_Customize_Setting( $this, $id, $args );
+
+                $this-&gt;settings[ $setting-&gt;id ] = $setting;
+        }
+
+        /**
+         * Retrieve a customize setting.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the setting.
+         * @return object The settings object.
+         */
+        public function get_setting( $id ) {
+                if ( isset( $this-&gt;settings[ $id ] ) )
+                        return $this-&gt;settings[ $id ];
+        }
+
+        /**
+         * Remove a customize setting.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the setting.
+         */
+        public function remove_setting( $id ) {
+                unset( $this-&gt;settings[ $id ] );
+        }
+
+        /**
+         * Add a customize section.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the section.
+         * @param array $args Section arguments.
+         */
+        public function add_section( $id, $args = array() ) {
+                if ( is_a( $id, 'WP_Customize_Section' ) )
+                        $section = $id;
+                else
+                        $section = new WP_Customize_Section( $this, $id, $args );
+
+                $this-&gt;sections[ $section-&gt;id ] = $section;
+        }
+
+        /**
+         * Retrieve a customize section.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the section.
+         * @return object The section object.
+         */
+        public function get_section( $id ) {
+                if ( isset( $this-&gt;sections[ $id ] ) )
+                        return $this-&gt;sections[ $id ];
+        }
+
+        /**
+         * Remove a customize section.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the section.
+         */
+        public function remove_section( $id ) {
+                unset( $this-&gt;sections[ $id ] );
+        }
+
+        /**
+         * Add a customize control.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the control.
+         * @param array $args Setting arguments.
+         */
+        public function add_control( $id, $args = array() ) {
+                if ( is_a( $id, 'WP_Customize_Control' ) )
+                        $control = $id;
+                else
+                        $control = new WP_Customize_Control( $this, $id, $args );
+
+                $this-&gt;controls[ $control-&gt;id ] = $control;
+        }
+
+        /**
+         * Retrieve a customize control.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the control.
+         * @return object The settings object.
+         */
+        public function get_control( $id ) {
+                if ( isset( $this-&gt;controls[ $id ] ) )
+                        return $this-&gt;controls[ $id ];
+        }
+
+        /**
+         * Remove a customize setting.
+         *
+         * @since 3.4.0
+         *
+         * @param string $id A specific ID of the control.
+         */
+        public function remove_control( $id ) {
+                unset( $this-&gt;controls[ $id ] );
+        }
+
+        /**
+         * Helper function to compare two objects by priority.
+         *
+         * @since 3.4.0
+         *
+         * @param object $a Object A.
+         * @param object $b Object B.
+         */
+        protected final function _cmp_priority( $a, $b ) {
+                $ap = $a-&gt;priority;
+                $bp = $b-&gt;priority;
+
+                if ( $ap == $bp )
+                        return 0;
+                return ( $ap &gt; $bp ) ? 1 : -1;
+        }
+
+        /**
+         * Prepare settings and sections.
+         *
+         * @since 3.4.0
+         */
+        public function prepare_controls() {
+                // Prepare controls
+                // Reversing makes uasort sort by time added when conflicts occur.
+
+                $this-&gt;controls = array_reverse( $this-&gt;controls );
+                $controls = array();
+
+                foreach ( $this-&gt;controls as $id =&gt; $control ) {
+                        if ( ! isset( $this-&gt;sections[ $control-&gt;section ] ) || ! $control-&gt;check_capabilities() )
+                                continue;
+
+                        $this-&gt;sections[ $control-&gt;section ]-&gt;controls[] = $control;
+                        $controls[ $id ] = $control;
+                }
+                $this-&gt;controls = $controls;
+
+                // Prepare sections
+                $this-&gt;sections = array_reverse( $this-&gt;sections );
+                uasort( $this-&gt;sections, array( $this, '_cmp_priority' ) );
+                $sections = array();
+
+                foreach ( $this-&gt;sections as $section ) {
+                        if ( ! $section-&gt;check_capabilities() || ! $section-&gt;controls )
+                                continue;
+
+                        usort( $section-&gt;controls, array( $this, '_cmp_priority' ) );
+                        $sections[] = $section;
+                }
+                $this-&gt;sections = $sections;
+        }
+
+        /**
+         * Enqueue scripts for customize controls.
+         *
+         * @since 3.4.0
+         */
+        public function enqueue_control_scripts() {
+                foreach ( $this-&gt;controls as $control ) {
+                        $control-&gt;enqueue();
+                }
+        }
+
+        /**
+         * Register some default controls.
+         *
+         * @since 3.4.0
+         */
+        public function register_controls() {
+
+                /* Custom Header */
+
+                $this-&gt;add_section( 'header', array(
+                        'title'          =&gt; __( 'Header' ),
+                        'theme_supports' =&gt; 'custom-header',
+                        'priority'       =&gt; 20,
+                ) );
+
+                $this-&gt;add_setting( 'header_textcolor', array(
+                        'sanitize_callback' =&gt; 'sanitize_header_textcolor',
+                        'theme_supports' =&gt; array( 'custom-header', 'header-text' ),
+                        'default'        =&gt; get_theme_support( 'custom-header', 'default-text-color' ),
+                ) );
+
+                $this-&gt;add_control( 'display_header_text', array(
+                        'settings' =&gt; 'header_textcolor',
+                        'label'    =&gt; __( 'Display Header Text' ),
+                        'section'  =&gt; 'header',
+                        'type'     =&gt; 'checkbox',
+                ) );
+
+                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'header_textcolor', array(
+                        'label'   =&gt; __( 'Text Color' ),
+                        'section' =&gt; 'header',
+                ) ) );
+
+                // Input type: checkbox
+                // With custom value
+                $this-&gt;add_setting( 'header_image', array(
+                        'default'        =&gt; get_theme_support( 'custom-header', 'default-image' ),
+                        'theme_supports' =&gt; 'custom-header',
+                ) );
+
+                $this-&gt;add_control( new WP_Customize_Header_Image_Control( $this ) );
+
+                /* Custom Background */
+
+                $this-&gt;add_section( 'background', array(
+                        'title'          =&gt; __( 'Background' ),
+                        'theme_supports' =&gt; 'custom-background',
+                        'priority'       =&gt; 30,
+                ) );
+
+                // Input type: Color
+                // With sanitize_callback
+                $this-&gt;add_setting( 'background_color', array(
+                        'default'           =&gt; get_theme_support( 'custom-background', 'default-color' ),
+                        'sanitize_callback' =&gt; 'sanitize_hexcolor',
+                        'theme_supports'    =&gt; 'custom-background',
+                        'transport'         =&gt; 'postMessage',
+                ) );
+
+                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'background_color', array(
+                        'label'   =&gt; __( 'Background Color' ),
+                        'section' =&gt; 'background',
+                ) ) );
+
+                $this-&gt;add_setting( 'background_image', array(
+                        'default'        =&gt; get_theme_support( 'custom-background', 'default-image' ),
+                        'theme_supports' =&gt; 'custom-background',
+                ) );
+
+                $this-&gt;add_control( new WP_Customize_Image_Control( $this, 'background_image', array(
+                        'label'          =&gt; __( 'Background Image' ),
+                        'section'        =&gt; 'background',
+                        'context'        =&gt; 'custom-background',
+                ) ) );
+
+                $this-&gt;add_setting( 'background_repeat', array(
+                        'default'        =&gt; 'repeat',
+                        'theme_supports' =&gt; 'custom-background',
+                ) );
+
+                $this-&gt;add_control( 'background_repeat', array(
+                        'label'      =&gt; __( 'Background Repeat' ),
+                        'section'    =&gt; 'background',
+                        'type'       =&gt; 'radio',
+                        'choices'    =&gt; array(
+                                'no-repeat'  =&gt; __('No Repeat'),
+                                'repeat'     =&gt; __('Tile'),
+                                'repeat-x'   =&gt; __('Tile Horizontally'),
+                                'repeat-y'   =&gt; __('Tile Vertically'),
+                        ),
+                ) );
+
+                $this-&gt;add_setting( 'background_position_x', array(
+                        'default'        =&gt; 'left',
+                        'theme_supports' =&gt; 'custom-background',
+                ) );
+
+                $this-&gt;add_control( 'background_position_x', array(
+                        'label'      =&gt; __( 'Background Position' ),
+                        'section'    =&gt; 'background',
+                        'type'       =&gt; 'radio',
+                        'choices'    =&gt; array(
+                                'left'       =&gt; __('Left'),
+                                'center'     =&gt; __('Center'),
+                                'right'      =&gt; __('Right'),
+                        ),
+                ) );
+
+                $this-&gt;add_setting( 'background_attachment', array(
+                        'default'        =&gt; 'fixed',
+                        'theme_supports' =&gt; 'custom-background',
+                ) );
+
+                $this-&gt;add_control( 'background_attachment', array(
+                        'label'      =&gt; __( 'Background Attachment' ),
+                        'section'    =&gt; 'background',
+                        'type'       =&gt; 'radio',
+                        'choices'    =&gt; array(
+                                'fixed'      =&gt; __('Fixed'),
+                                'scroll'     =&gt; __('Scroll'),
+                        ),
+                ) );
+
+                /* Nav Menus */
+
+                $locations      = get_registered_nav_menus();
+                $menus          = wp_get_nav_menus();
+                $menu_locations = get_nav_menu_locations();
+                $num_locations  = count( array_keys( $locations ) );
+
+                $this-&gt;add_section( 'nav', array(
+                        'title'          =&gt; __( 'Navigation' ),
+                        'theme_supports' =&gt; 'menus',
+                        'priority'       =&gt; 40,
+                        'description'    =&gt; sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . &quot;\n\n&quot; . __('You can edit your menu content on the Menus screen in the Appearance section.'),
+                ) );
+
+                if ( $menus ) {
+                        $choices = array( 0 =&gt; __( '&amp;mdash; Select &amp;mdash;' ) );
+                        foreach ( $menus as $menu ) {
+                                $truncated_name = wp_html_excerpt( $menu-&gt;name, 40 );
+                                $truncated_name = ( $truncated_name == $menu-&gt;name ) ? $menu-&gt;name : trim( $truncated_name ) . '&amp;hellip;';
+                                $choices[ $menu-&gt;term_id ] = $truncated_name;
+                        }
+
+                        foreach ( $locations as $location =&gt; $description ) {
+                                $menu_setting_id = &quot;nav_menu_locations[{$location}]&quot;;
+
+                                $this-&gt;add_setting( $menu_setting_id, array(
+                                        'sanitize_callback' =&gt; 'absint',
+                                        'theme_supports'    =&gt; 'menus',
+                                ) );
+
+                                $this-&gt;add_control( $menu_setting_id, array(
+                                        'label'   =&gt; $description,
+                                        'section' =&gt; 'nav',
+                                        'type'    =&gt; 'select',
+                                        'choices' =&gt; $choices,
+                                ) );
+                        }
+                }
+
+                /* Static Front Page */
+                // #WP19627
+
+                $this-&gt;add_section( 'static_front_page', array(
+                        'title'          =&gt; __( 'Static Front Page' ),
+                //        'theme_supports' =&gt; 'static-front-page',
+                        'priority'       =&gt; 50,
+                        'description'    =&gt; __( 'Your theme supports a static front page.' ),
+                ) );
+
+                $this-&gt;add_setting( 'show_on_front', array(
+                        'default'        =&gt; get_option( 'show_on_front' ),
+                        'capability'     =&gt; 'manage_options',
+                        'type'           =&gt; 'option',
+                //        'theme_supports' =&gt; 'static-front-page',
+                ) );
+
+                $this-&gt;add_control( 'show_on_front', array(
+                        'label'   =&gt; __( 'Front page displays' ),
+                        'section' =&gt; 'static_front_page',
+                        'type'    =&gt; 'radio',
+                        'choices' =&gt; array(
+                                'posts' =&gt; __( 'Your latest posts' ),
+                                'page'  =&gt; __( 'A static page' ),
+                        ),
+                ) );
+
+                $this-&gt;add_setting( 'page_on_front', array(
+                        'type'       =&gt; 'option',
+                        'capability' =&gt; 'manage_options',
+                //        'theme_supports' =&gt; 'static-front-page',
+                ) );
+
+                $this-&gt;add_control( 'page_on_front', array(
+                        'label'      =&gt; __( 'Front page' ),
+                        'section'    =&gt; 'static_front_page',
+                        'type'       =&gt; 'dropdown-pages',
+                ) );
+
+                $this-&gt;add_setting( 'page_for_posts', array(
+                        'type'           =&gt; 'option',
+                        'capability'     =&gt; 'manage_options',
+                //        'theme_supports' =&gt; 'static-front-page',
+                ) );
+
+                $this-&gt;add_control( 'page_for_posts', array(
+                        'label'      =&gt; __( 'Posts page' ),
+                        'section'    =&gt; 'static_front_page',
+                        'type'       =&gt; 'dropdown-pages',
+                ) );
+
+                /* Site Title &amp; Tagline */
+
+                $this-&gt;add_section( 'strings', array(
+                        'title'    =&gt; __( 'Site Title &amp; Tagline' ),
+                        'priority' =&gt; 5,
+                ) );
+
+                $this-&gt;add_setting( 'blogname', array(
+                        'default'    =&gt; get_option( 'blogname' ),
+                        'type'       =&gt; 'option',
+                        'capability' =&gt; 'manage_options',
+                ) );
+
+                $this-&gt;add_control( 'blogname', array(
+                        'label'      =&gt; __( 'Site Title' ),
+                        'section'    =&gt; 'strings',
+                ) );
+
+                $this-&gt;add_setting( 'blogdescription', array(
+                        'default'    =&gt; get_option( 'blogdescription' ),
+                        'type'       =&gt; 'option',
+                        'capability' =&gt; 'manage_options',
+                ) );
+
+                $this-&gt;add_control( 'blogdescription', array(
+                        'label'      =&gt; __( 'Tagline' ),
+                        'section'    =&gt; 'strings',
+                ) );
+        }
+};
+
+// Callback function for sanitizing the header textcolor setting.
+function sanitize_header_textcolor( $color ) {
+        if ( empty( $color ) )
+                return get_theme_support( 'custom-header', 'default-text-color' );
+
+        elseif ( $color == 'blank' )
+                return 'blank';
+
+        return sanitize_hexcolor( $color );
+}
+
+// Callback function for sanitizing a hex color
+function sanitize_hexcolor( $color ) {
+        $color = preg_replace( '/[^0-9a-fA-F]/', '', $color );
+
+        if ( preg_match('|[A-Fa-f0-9]{3,6}|', $color ) )
+                return $color;
+
+        return $color;
+}
</ins></span></pre></div>
<a id="trunkwpincludesclasswpcustomizephp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-includes/class-wp-customize.php (20851 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize.php        2012-05-23 15:36:27 UTC (rev 20851)
+++ trunk/wp-includes/class-wp-customize.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -1,814 +0,0 @@
</span><del>-&lt;?php
-/**
- * Customize
- *
- * @package WordPress
- * @subpackage Customize
- * @since 3.4.0
- */
-
-final class WP_Customize {
-        protected $theme;
-        protected $original_stylesheet;
-
-        protected $previewing = false;
-
-        protected $settings = array();
-        protected $sections = array();
-        protected $controls = array();
-
-        protected $customized;
-
-        private $_post_values;
-
-        /**
-         * Constructor.
-         *
-         * @since 3.4.0
-         */
-        public function __construct() {
-                require( ABSPATH . WPINC . '/class-wp-customize-setting.php' );
-                require( ABSPATH . WPINC . '/class-wp-customize-section.php' );
-                require( ABSPATH . WPINC . '/class-wp-customize-control.php' );
-
-                add_action( 'setup_theme',  array( $this, 'setup_theme' ) );
-                add_action( 'admin_init',   array( $this, 'admin_init' ) );
-                add_action( 'wp_loaded',    array( $this, 'wp_loaded' ) );
-
-                add_action( 'wp_ajax_customize_save', array( $this, 'save' ) );
-
-                add_action( 'customize_register',                 array( $this, 'register_controls' ) );
-                add_action( 'customize_controls_init',            array( $this, 'prepare_controls' ) );
-                add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_control_scripts' ) );
-        }
-
-        /**
-         * Update theme modifications for the current theme.
-         * Note: Candidate core function.
-         * http://core.trac.wordpress.org/ticket/20091
-         *
-         * @since 3.4.0
-         *
-         * @param array $mods Theme modifications.
-         */
-        public function set_theme_mods( $mods ) {
-                $current = get_theme_mods();
-
-                $mods = wp_parse_args( $mods, $current );
-
-                $theme = get_stylesheet();
-                update_option( &quot;theme_mods_$theme&quot;, $mods );
-        }
-
-        /**
-         * Start preview and customize theme.
-         *
-         * Check if customize query variable exist. Init filters to filter the current theme.
-         *
-         * @since 3.4.0
-         */
-        public function setup_theme() {
-                if ( ! isset( $_REQUEST['customize'] ) || 'on' != $_REQUEST['customize'] )
-                        return;
-
-                send_origin_headers();
-
-                $this-&gt;start_previewing_theme();
-                show_admin_bar( false );
-        }
-
-        /**
-         * Start previewing the selected theme.
-         *
-         * Adds filters to change the current theme.
-         *
-         * @since 3.4.0
-         */
-        public function start_previewing_theme() {
-                if ( $this-&gt;is_preview() || false === $this-&gt;theme || ( $this-&gt;theme &amp;&amp; ! $this-&gt;theme-&gt;exists() ) )
-                        return;
-
-                // Initialize $theme and $original_stylesheet if they do not yet exist.
-                if ( ! isset( $this-&gt;theme ) ) {
-                        $this-&gt;theme = wp_get_theme( $_REQUEST['theme'] );
-                        if ( ! $this-&gt;theme-&gt;exists() ) {
-                                $this-&gt;theme = false;
-                                return;
-                        }
-                }
-
-                $this-&gt;original_stylesheet = get_stylesheet();
-
-                $this-&gt;previewing = true;
-
-                add_filter( 'template', array( $this, 'get_template' ) );
-                add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
-                add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
-
-                // @link: http://core.trac.wordpress.org/ticket/20027
-                add_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
-                add_filter( 'pre_option_template', array( $this, 'get_template' ) );
-
-                // Handle custom theme roots.
-                add_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
-                add_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
-
-                do_action( 'start_previewing_theme', $this );
-        }
-
-        /**
-         * Stop previewing the selected theme.
-         *
-         * Removes filters to change the current theme.
-         *
-         * @since 3.4.0
-         */
-        public function stop_previewing_theme() {
-                if ( ! $this-&gt;is_preview() )
-                        return;
-
-                $this-&gt;previewing = false;
-
-                remove_filter( 'template', array( $this, 'get_template' ) );
-                remove_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
-                remove_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
-
-                // @link: http://core.trac.wordpress.org/ticket/20027
-                remove_filter( 'pre_option_stylesheet', array( $this, 'get_stylesheet' ) );
-                remove_filter( 'pre_option_template', array( $this, 'get_template' ) );
-
-                // Handle custom theme roots.
-                remove_filter( 'pre_option_stylesheet_root', array( $this, 'get_stylesheet_root' ) );
-                remove_filter( 'pre_option_template_root', array( $this, 'get_template_root' ) );
-
-                do_action( 'stop_previewing_theme', $this );
-        }
-
-        /**
-         * Checks if the current theme is active.
-         *
-         * @since 3.4.0
-         */
-        public function is_current_theme_active() {
-                return $this-&gt;get_stylesheet() == $this-&gt;original_stylesheet;
-        }
-
-        /**
-         * Register styles/scripts and initialize the preview of each setting
-         *
-         * @since 3.4.0
-         */
-        public function wp_loaded() {
-                do_action( 'customize_register', $this );
-
-                if ( $this-&gt;is_preview() &amp;&amp; ! is_admin() )
-                        $this-&gt;customize_preview_init();
-        }
-
-        /**
-         * Decode the $_POST attribute used to override the WP_Customize_Setting values.
-         *
-         * @since 3.4.0
-         */
-        public function post_value( $setting ) {
-                if ( ! isset( $this-&gt;_post_values ) ) {
-                        if ( isset( $_POST['customized'] ) )
-                                $this-&gt;_post_values = json_decode( stripslashes( $_POST['customized'] ), true );
-                        else
-                                $this-&gt;_post_values = false;
-                }
-
-                if ( isset( $this-&gt;_post_values[ $setting-&gt;id ] ) )
-                        return $setting-&gt;sanitize( $this-&gt;_post_values[ $setting-&gt;id ] );
-        }
-
-
-        /**
-         * Print javascript settings.
-         *
-         * @since 3.4.0
-         */
-        public function customize_preview_init() {
-                $this-&gt;prepare_controls();
-
-                wp_enqueue_script( 'customize-preview' );
-                add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
-
-                foreach ( $this-&gt;settings as $setting ) {
-                        $setting-&gt;preview();
-                }
-
-                do_action( 'customize_preview_init', $this );
-        }
-
-
-        /**
-         * Print javascript settings.
-         *
-         * @since 3.4.0
-         */
-        public function customize_preview_settings() {
-                $settings = array(
-                        'values' =&gt; array(),
-                );
-
-                foreach ( $this-&gt;settings as $id =&gt; $setting ) {
-                        $settings['values'][ $id ] = $setting-&gt;js_value();
-                }
-
-                ?&gt;
-                &lt;script type=&quot;text/javascript&quot;&gt;
-                        var _wpCustomizeSettings = &lt;?php echo json_encode( $settings ); ?&gt;;
-                &lt;/script&gt;
-                &lt;?php
-        }
-
-        /**
-         * Is it a theme preview?
-         *
-         * @since 3.4.0
-         *
-         * @return bool True if it's a preview, false if not.
-         */
-        public function is_preview() {
-                return (bool) $this-&gt;previewing;
-        }
-
-        /**
-         * Retrieve the template name of the previewed theme.
-         *
-         * @since 3.4.0
-         *
-         * @return string Template name.
-         */
-        public function get_template() {
-                return $this-&gt;theme-&gt;get_template();
-        }
-
-        /**
-         * Retrieve the stylesheet name of the previewed theme.
-         *
-         * @since 3.4.0
-         *
-         * @return string Stylesheet name.
-         */
-        public function get_stylesheet() {
-                return $this-&gt;theme-&gt;get_stylesheet();
-        }
-
-        /**
-         * Retrieve the template root of the previewed theme.
-         *
-         * @since 3.4.0
-         *
-         * @return string Theme root.
-         */
-        public function get_template_root() {
-                return get_raw_theme_root( $this-&gt;get_template(), true );
-        }
-
-        /**
-         * Retrieve the stylesheet root of the previewed theme.
-         *
-         * @since 3.4.0
-         *
-         * @return string Theme root.
-         */
-        public function get_stylesheet_root() {
-                return get_raw_theme_root( $this-&gt;get_stylesheet(), true );
-        }
-
-        /**
-         * Filter the current theme and return the name of the previewed theme.
-         *
-         * @since 3.4.0
-         *
-         * @return string Theme name.
-         */
-        public function current_theme( $current_theme ) {
-                return $this-&gt;theme-&gt;display('Name');
-        }
-
-        /**
-         * Trigger save action and load customize controls.
-         *
-         * @since 3.4.0
-         */
-        public function admin_init() {
-                if ( ( defined( 'DOING_AJAX' ) &amp;&amp; DOING_AJAX ) )
-                        return;
-
-                if ( ! isset( $_GET['customize'] ) || 'on' != $_GET['customize'] )
-                        return;
-
-                if ( empty( $_GET['theme'] ) )
-                        return;
-
-                if ( ! $this-&gt;is_preview() )
-                        return;
-
-                if ( ! current_user_can( 'edit_theme_options' ) )
-                        return;
-
-                include( ABSPATH . WPINC . '/customize-controls.php' );
-
-                die;
-        }
-
-        /**
-         * Switch the theme and trigger the save action of each setting.
-         *
-         * @since 3.4.0
-         */
-        public function save() {
-                if ( ! $this-&gt;is_preview() )
-                        die;
-
-                check_ajax_referer( 'customize_controls', 'nonce' );
-
-                // Do we have to switch themes?
-                if ( $this-&gt;get_stylesheet() != $this-&gt;original_stylesheet ) {
-                        if ( ! current_user_can( 'switch_themes' ) )
-                                die;
-
-                        // Temporarily stop previewing the theme to allow switch_themes()
-                        // to operate properly.
-                        $this-&gt;stop_previewing_theme();
-                        switch_theme( $this-&gt;get_template(), $this-&gt;get_stylesheet() );
-                        $this-&gt;start_previewing_theme();
-                }
-
-                do_action( 'customize_save', $this );
-
-                foreach ( $this-&gt;settings as $setting ) {
-                        $setting-&gt;save();
-                }
-
-                add_action( 'admin_notices', array( $this, '_save_feedback' ) );
-
-                die;
-        }
-
-        /**
-         * Show an admin notice after settings are saved.
-         *
-         * @since 3.4.0
-         */
-        public function _save_feedback() {
-                ?&gt;
-                &lt;div class=&quot;updated&quot;&gt;&lt;p&gt;&lt;?php printf( __( 'Settings saved and theme activated. &lt;a href=&quot;%s&quot;&gt;Visit site&lt;/a&gt;.' ), home_url( '/' ) ); ?&gt;&lt;/p&gt;&lt;/div&gt;
-                &lt;?php
-        }
-
-        /**
-         * Add a customize setting.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the setting. Can be a
-         *                   theme mod or option name.
-         * @param array $args Setting arguments.
-         */
-        public function add_setting( $id, $args = array() ) {
-                if ( is_a( $id, 'WP_Customize_Setting' ) )
-                        $setting = $id;
-                else
-                        $setting = new WP_Customize_Setting( $this, $id, $args );
-
-                $this-&gt;settings[ $setting-&gt;id ] = $setting;
-        }
-
-        /**
-         * Retrieve a customize setting.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the setting.
-         * @return object The settings object.
-         */
-        public function get_setting( $id ) {
-                if ( isset( $this-&gt;settings[ $id ] ) )
-                        return $this-&gt;settings[ $id ];
-        }
-
-        /**
-         * Remove a customize setting.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the setting.
-         */
-        public function remove_setting( $id ) {
-                unset( $this-&gt;settings[ $id ] );
-        }
-
-        /**
-         * Add a customize section.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the section.
-         * @param array $args Section arguments.
-         */
-        public function add_section( $id, $args = array() ) {
-                if ( is_a( $id, 'WP_Customize_Section' ) )
-                        $section = $id;
-                else
-                        $section = new WP_Customize_Section( $this, $id, $args );
-
-                $this-&gt;sections[ $section-&gt;id ] = $section;
-        }
-
-        /**
-         * Retrieve a customize section.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the section.
-         * @return object The section object.
-         */
-        public function get_section( $id ) {
-                if ( isset( $this-&gt;sections[ $id ] ) )
-                        return $this-&gt;sections[ $id ];
-        }
-
-        /**
-         * Remove a customize section.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the section.
-         */
-        public function remove_section( $id ) {
-                unset( $this-&gt;sections[ $id ] );
-        }
-
-        /**
-         * Add a customize control.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the control.
-         * @param array $args Setting arguments.
-         */
-        public function add_control( $id, $args = array() ) {
-                if ( is_a( $id, 'WP_Customize_Control' ) )
-                        $control = $id;
-                else
-                        $control = new WP_Customize_Control( $this, $id, $args );
-
-                $this-&gt;controls[ $control-&gt;id ] = $control;
-        }
-
-        /**
-         * Retrieve a customize control.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the control.
-         * @return object The settings object.
-         */
-        public function get_control( $id ) {
-                if ( isset( $this-&gt;controls[ $id ] ) )
-                        return $this-&gt;controls[ $id ];
-        }
-
-        /**
-         * Remove a customize setting.
-         *
-         * @since 3.4.0
-         *
-         * @param string $id A specific ID of the control.
-         */
-        public function remove_control( $id ) {
-                unset( $this-&gt;controls[ $id ] );
-        }
-
-        /**
-         * Helper function to compare two objects by priority.
-         *
-         * @since 3.4.0
-         *
-         * @param object $a Object A.
-         * @param object $b Object B.
-         */
-        protected final function _cmp_priority( $a, $b ) {
-                $ap = $a-&gt;priority;
-                $bp = $b-&gt;priority;
-
-                if ( $ap == $bp )
-                        return 0;
-                return ( $ap &gt; $bp ) ? 1 : -1;
-        }
-
-        /**
-         * Prepare settings and sections.
-         *
-         * @since 3.4.0
-         */
-        public function prepare_controls() {
-                // Prepare controls
-                // Reversing makes uasort sort by time added when conflicts occur.
-
-                $this-&gt;controls = array_reverse( $this-&gt;controls );
-                $controls = array();
-
-                foreach ( $this-&gt;controls as $id =&gt; $control ) {
-                        if ( ! isset( $this-&gt;sections[ $control-&gt;section ] ) || ! $control-&gt;check_capabilities() )
-                                continue;
-
-                        $this-&gt;sections[ $control-&gt;section ]-&gt;controls[] = $control;
-                        $controls[ $id ] = $control;
-                }
-                $this-&gt;controls = $controls;
-
-                // Prepare sections
-                $this-&gt;sections = array_reverse( $this-&gt;sections );
-                uasort( $this-&gt;sections, array( $this, '_cmp_priority' ) );
-                $sections = array();
-
-                foreach ( $this-&gt;sections as $section ) {
-                        if ( ! $section-&gt;check_capabilities() || ! $section-&gt;controls )
-                                continue;
-
-                        usort( $section-&gt;controls, array( $this, '_cmp_priority' ) );
-                        $sections[] = $section;
-                }
-                $this-&gt;sections = $sections;
-        }
-
-        /**
-         * Enqueue scripts for customize controls.
-         *
-         * @since 3.4.0
-         */
-        public function enqueue_control_scripts() {
-                foreach ( $this-&gt;controls as $control ) {
-                        $control-&gt;enqueue();
-                }
-        }
-
-        /**
-         * Register some default controls.
-         *
-         * @since 3.4.0
-         */
-        public function register_controls() {
-
-                /* Custom Header */
-
-                $this-&gt;add_section( 'header', array(
-                        'title'          =&gt; __( 'Header' ),
-                        'theme_supports' =&gt; 'custom-header',
-                        'priority'       =&gt; 20,
-                ) );
-
-                $this-&gt;add_setting( 'header_textcolor', array(
-                        'sanitize_callback' =&gt; 'sanitize_header_textcolor',
-                        'theme_supports' =&gt; array( 'custom-header', 'header-text' ),
-                        'default'        =&gt; get_theme_support( 'custom-header', 'default-text-color' ),
-                ) );
-
-                $this-&gt;add_control( 'display_header_text', array(
-                        'settings' =&gt; 'header_textcolor',
-                        'label'    =&gt; __( 'Display Header Text' ),
-                        'section'  =&gt; 'header',
-                        'type'     =&gt; 'checkbox',
-                ) );
-
-                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'header_textcolor', array(
-                        'label'   =&gt; __( 'Text Color' ),
-                        'section' =&gt; 'header',
-                ) ) );
-
-                // Input type: checkbox
-                // With custom value
-                $this-&gt;add_setting( 'header_image', array(
-                        'default'        =&gt; get_theme_support( 'custom-header', 'default-image' ),
-                        'theme_supports' =&gt; 'custom-header',
-                ) );
-
-                $this-&gt;add_control( new WP_Customize_Header_Image_Control( $this ) );
-
-                /* Custom Background */
-
-                $this-&gt;add_section( 'background', array(
-                        'title'          =&gt; __( 'Background' ),
-                        'theme_supports' =&gt; 'custom-background',
-                        'priority'       =&gt; 30,
-                ) );
-
-                // Input type: Color
-                // With sanitize_callback
-                $this-&gt;add_setting( 'background_color', array(
-                        'default'           =&gt; get_theme_support( 'custom-background', 'default-color' ),
-                        'sanitize_callback' =&gt; 'sanitize_hexcolor',
-                        'theme_supports'    =&gt; 'custom-background',
-                        'transport'         =&gt; 'postMessage',
-                ) );
-
-                $this-&gt;add_control( new WP_Customize_Color_Control( $this, 'background_color', array(
-                        'label'   =&gt; __( 'Background Color' ),
-                        'section' =&gt; 'background',
-                ) ) );
-
-                $this-&gt;add_setting( 'background_image', array(
-                        'default'        =&gt; get_theme_support( 'custom-background', 'default-image' ),
-                        'theme_supports' =&gt; 'custom-background',
-                ) );
-
-                $this-&gt;add_control( new WP_Customize_Image_Control( $this, 'background_image', array(
-                        'label'          =&gt; __( 'Background Image' ),
-                        'section'        =&gt; 'background',
-                        'context'        =&gt; 'custom-background',
-                ) ) );
-
-                $this-&gt;add_setting( 'background_repeat', array(
-                        'default'        =&gt; 'repeat',
-                        'theme_supports' =&gt; 'custom-background',
-                ) );
-
-                $this-&gt;add_control( 'background_repeat', array(
-                        'label'      =&gt; __( 'Background Repeat' ),
-                        'section'    =&gt; 'background',
-                        'type'       =&gt; 'radio',
-                        'choices'    =&gt; array(
-                                'no-repeat'  =&gt; __('No Repeat'),
-                                'repeat'     =&gt; __('Tile'),
-                                'repeat-x'   =&gt; __('Tile Horizontally'),
-                                'repeat-y'   =&gt; __('Tile Vertically'),
-                        ),
-                ) );
-
-                $this-&gt;add_setting( 'background_position_x', array(
-                        'default'        =&gt; 'left',
-                        'theme_supports' =&gt; 'custom-background',
-                ) );
-
-                $this-&gt;add_control( 'background_position_x', array(
-                        'label'      =&gt; __( 'Background Position' ),
-                        'section'    =&gt; 'background',
-                        'type'       =&gt; 'radio',
-                        'choices'    =&gt; array(
-                                'left'       =&gt; __('Left'),
-                                'center'     =&gt; __('Center'),
-                                'right'      =&gt; __('Right'),
-                        ),
-                ) );
-
-                $this-&gt;add_setting( 'background_attachment', array(
-                        'default'        =&gt; 'fixed',
-                        'theme_supports' =&gt; 'custom-background',
-                ) );
-
-                $this-&gt;add_control( 'background_attachment', array(
-                        'label'      =&gt; __( 'Background Attachment' ),
-                        'section'    =&gt; 'background',
-                        'type'       =&gt; 'radio',
-                        'choices'    =&gt; array(
-                                'fixed'      =&gt; __('Fixed'),
-                                'scroll'     =&gt; __('Scroll'),
-                        ),
-                ) );
-
-                /* Nav Menus */
-
-                $locations      = get_registered_nav_menus();
-                $menus          = wp_get_nav_menus();
-                $menu_locations = get_nav_menu_locations();
-                $num_locations  = count( array_keys( $locations ) );
-
-                $this-&gt;add_section( 'nav', array(
-                        'title'          =&gt; __( 'Navigation' ),
-                        'theme_supports' =&gt; 'menus',
-                        'priority'       =&gt; 40,
-                        'description'    =&gt; sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . &quot;\n\n&quot; . __('You can edit your menu content on the Menus screen in the Appearance section.'),
-                ) );
-
-                if ( $menus ) {
-                        $choices = array( 0 =&gt; __( '&amp;mdash; Select &amp;mdash;' ) );
-                        foreach ( $menus as $menu ) {
-                                $truncated_name = wp_html_excerpt( $menu-&gt;name, 40 );
-                                $truncated_name = ( $truncated_name == $menu-&gt;name ) ? $menu-&gt;name : trim( $truncated_name ) . '&amp;hellip;';
-                                $choices[ $menu-&gt;term_id ] = $truncated_name;
-                        }
-
-                        foreach ( $locations as $location =&gt; $description ) {
-                                $menu_setting_id = &quot;nav_menu_locations[{$location}]&quot;;
-
-                                $this-&gt;add_setting( $menu_setting_id, array(
-                                        'sanitize_callback' =&gt; 'absint',
-                                        'theme_supports'    =&gt; 'menus',
-                                ) );
-
-                                $this-&gt;add_control( $menu_setting_id, array(
-                                        'label'   =&gt; $description,
-                                        'section' =&gt; 'nav',
-                                        'type'    =&gt; 'select',
-                                        'choices' =&gt; $choices,
-                                ) );
-                        }
-                }
-
-                /* Static Front Page */
-                // #WP19627
-
-                $this-&gt;add_section( 'static_front_page', array(
-                        'title'          =&gt; __( 'Static Front Page' ),
-                //        'theme_supports' =&gt; 'static-front-page',
-                        'priority'       =&gt; 50,
-                        'description'    =&gt; __( 'Your theme supports a static front page.' ),
-                ) );
-
-                $this-&gt;add_setting( 'show_on_front', array(
-                        'default'        =&gt; get_option( 'show_on_front' ),
-                        'capability'     =&gt; 'manage_options',
-                        'type'           =&gt; 'option',
-                //        'theme_supports' =&gt; 'static-front-page',
-                ) );
-
-                $this-&gt;add_control( 'show_on_front', array(
-                        'label'   =&gt; __( 'Front page displays' ),
-                        'section' =&gt; 'static_front_page',
-                        'type'    =&gt; 'radio',
-                        'choices' =&gt; array(
-                                'posts' =&gt; __( 'Your latest posts' ),
-                                'page'  =&gt; __( 'A static page' ),
-                        ),
-                ) );
-
-                $this-&gt;add_setting( 'page_on_front', array(
-                        'type'       =&gt; 'option',
-                        'capability' =&gt; 'manage_options',
-                //        'theme_supports' =&gt; 'static-front-page',
-                ) );
-
-                $this-&gt;add_control( 'page_on_front', array(
-                        'label'      =&gt; __( 'Front page' ),
-                        'section'    =&gt; 'static_front_page',
-                        'type'       =&gt; 'dropdown-pages',
-                ) );
-
-                $this-&gt;add_setting( 'page_for_posts', array(
-                        'type'           =&gt; 'option',
-                        'capability'     =&gt; 'manage_options',
-                //        'theme_supports' =&gt; 'static-front-page',
-                ) );
-
-                $this-&gt;add_control( 'page_for_posts', array(
-                        'label'      =&gt; __( 'Posts page' ),
-                        'section'    =&gt; 'static_front_page',
-                        'type'       =&gt; 'dropdown-pages',
-                ) );
-
-                /* Site Title &amp; Tagline */
-
-                $this-&gt;add_section( 'strings', array(
-                        'title'    =&gt; __( 'Site Title &amp; Tagline' ),
-                        'priority' =&gt; 5,
-                ) );
-
-                $this-&gt;add_setting( 'blogname', array(
-                        'default'    =&gt; get_option( 'blogname' ),
-                        'type'       =&gt; 'option',
-                        'capability' =&gt; 'manage_options',
-                ) );
-
-                $this-&gt;add_control( 'blogname', array(
-                        'label'      =&gt; __( 'Site Title' ),
-                        'section'    =&gt; 'strings',
-                ) );
-
-                $this-&gt;add_setting( 'blogdescription', array(
-                        'default'    =&gt; get_option( 'blogdescription' ),
-                        'type'       =&gt; 'option',
-                        'capability' =&gt; 'manage_options',
-                ) );
-
-                $this-&gt;add_control( 'blogdescription', array(
-                        'label'      =&gt; __( 'Tagline' ),
-                        'section'    =&gt; 'strings',
-                ) );
-        }
-};
-
-// Callback function for sanitizing the header textcolor setting.
-function sanitize_header_textcolor( $color ) {
-        if ( empty( $color ) )
-                return get_theme_support( 'custom-header', 'default-text-color' );
-
-        elseif ( $color == 'blank' )
-                return 'blank';
-
-        return sanitize_hexcolor( $color );
-}
-
-// Callback function for sanitizing a hex color
-function sanitize_hexcolor( $color ) {
-        $color = preg_replace( '/[^0-9a-fA-F]/', '', $color );
-
-        if ( preg_match('|[A-Fa-f0-9]{3,6}|', $color ) )
-                return $color;
-
-        return $color;
-}
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludescustomizecontrolsphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-includes/customize-controls.php (20851 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/customize-controls.php        2012-05-23 15:36:27 UTC (rev 20851)
+++ trunk/wp-includes/customize-controls.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -1,140 +0,0 @@
</span><del>-&lt;?php
-/**
- * Customize Controls
- *
- * @package WordPress
- * @subpackage Customize
- * @since 3.4.0
- */
-
-if ( ! defined( 'ABSPATH' ) )
-        die;
-
-global $wp_scripts;
-
-$registered = $wp_scripts-&gt;registered;
-$wp_scripts = new WP_Scripts;
-$wp_scripts-&gt;registered = $registered;
-
-add_action( 'customize_controls_print_scripts',        'print_head_scripts', 20 );
-add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts'     );
-add_action( 'customize_controls_print_styles',         'print_admin_styles', 20 );
-
-do_action( 'customize_controls_init' );
-
-wp_enqueue_script( 'customize-controls' );
-wp_enqueue_style( 'customize-controls' );
-
-do_action( 'customize_controls_enqueue_scripts' );
-
-// Let's roll.
-@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
-
-wp_user_settings();
-_wp_admin_html_begin();
-
-$admin_title = sprintf( __( '%1$s &amp;#8212; WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $this-&gt;theme-&gt;display('Name') ) ) );
-?&gt;&lt;title&gt;&lt;?php echo $admin_title; ?&gt;&lt;/title&gt;&lt;?php
-
-do_action( 'customize_controls_print_styles' );
-do_action( 'customize_controls_print_scripts' );
-?&gt;
-&lt;/head&gt;
-&lt;body class=&quot;wp-full-overlay&quot;&gt;
-        &lt;form id=&quot;customize-controls&quot; class=&quot;wrap wp-full-overlay-sidebar&quot;&gt;
-                &lt;?php wp_nonce_field( 'customize_controls' ); ?&gt;
-                &lt;div id=&quot;customize-header-actions&quot; class=&quot;wp-full-overlay-header&quot;&gt;
-                        &lt;a class=&quot;back&quot; href=&quot;&lt;?php echo esc_url( admin_url( 'themes.php' ) ); ?&gt;&quot;&gt;
-                                &lt;?php printf( __( '&amp;larr; Return to %s' ), __('Manage Themes') ); ?&gt;
-                        &lt;/a&gt;
-                &lt;/div&gt;
-
-                &lt;div class=&quot;wp-full-overlay-sidebar-content&quot;&gt;
-                        &lt;div id=&quot;customize-info&quot; class=&quot;customize-section&quot;&gt;
-                                &lt;div class=&quot;customize-section-title&quot;&gt;
-                                        &lt;span class=&quot;preview-notice&quot;&gt;&lt;?php _e('You are previewing'); ?&gt;&lt;/span&gt;
-                                        &lt;strong class=&quot;theme-name&quot;&gt;&lt;?php echo $this-&gt;theme-&gt;display('Name'); ?&gt;&lt;/strong&gt;
-                                &lt;/div&gt;
-                                &lt;div class=&quot;customize-section-content&quot;&gt;
-                                        &lt;?php if ( $screenshot = $this-&gt;theme-&gt;get_screenshot() ) : ?&gt;
-                                                &lt;img class=&quot;theme-screenshot&quot; src=&quot;&lt;?php echo esc_url( $screenshot ); ?&gt;&quot; /&gt;
-                                        &lt;?php endif; ?&gt;
-
-                                        &lt;?php if ( $this-&gt;theme-&gt;get('Description') ): ?&gt;
-                                                &lt;div class=&quot;theme-description&quot;&gt;&lt;?php echo $this-&gt;theme-&gt;display('Description'); ?&gt;&lt;/div&gt;
-                                        &lt;?php endif; ?&gt;
-                                &lt;/div&gt;
-                        &lt;/div&gt;
-
-                        &lt;div id=&quot;customize-theme-controls&quot;&gt;&lt;ul&gt;
-                                &lt;?php
-                                foreach ( $this-&gt;sections as $section )
-                                        $section-&gt;maybe_render();
-                                ?&gt;
-                        &lt;/ul&gt;&lt;/div&gt;
-                &lt;/div&gt;
-
-                &lt;div id=&quot;customize-footer-actions&quot; class=&quot;wp-full-overlay-footer&quot;&gt;
-                        &lt;?php
-                        $save_text = $this-&gt;is_current_theme_active() ? __('Save') : __('Save and Activate');
-                        submit_button( $save_text, 'primary', 'save', false );
-                        ?&gt;
-                        &lt;img src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; /&gt;
-
-                        &lt;a href=&quot;#&quot; class=&quot;collapse-sidebar button-secondary&quot; title=&quot;&lt;?php esc_attr_e('Collapse Sidebar'); ?&gt;&quot;&gt;
-                                &lt;span class=&quot;collapse-sidebar-label&quot;&gt;&lt;?php _e('Collapse'); ?&gt;&lt;/span&gt;
-                                &lt;span class=&quot;collapse-sidebar-arrow&quot;&gt;&lt;/span&gt;
-                        &lt;/a&gt;
-                &lt;/div&gt;
-        &lt;/form&gt;
-        &lt;div id=&quot;customize-preview&quot; class=&quot;wp-full-overlay-main&quot;&gt;&lt;/div&gt;
-        &lt;?php
-
-        do_action( 'customize_controls_print_footer_scripts' );
-
-        // If the frontend and the admin are served from the same domain, load the
-        // preview over ssl if the customizer is being loaded over ssl. This avoids
-        // insecure content warnings. This is not attempted if the admin and frontend
-        // are on different domains to avoid the case where the frontend doesn't have
-        // ssl certs. Domain mapping plugins can force ssl in these conditions using
-        // the customize_preview_link filter.
-        $admin_origin = parse_url( admin_url() );
-        $home_origin = parse_url( home_url() );
-        $scheme = null;
-        if ( is_ssl() &amp;&amp; ( $admin_origin[ 'host' ] == $home_origin[ 'host' ] ) )
-                $scheme = 'https';
-
-        $preview_url = apply_filters( 'customize_preview_link',  home_url( '/', $scheme ) );
-
-        $settings = array(
-                'theme'    =&gt; array(
-                        'stylesheet' =&gt; $this-&gt;get_stylesheet(),
-                        'active'     =&gt; $this-&gt;is_current_theme_active(),
-                ),
-                'url'      =&gt; array(
-                        'preview'  =&gt; esc_url( $preview_url ),
-                        'parent'   =&gt; esc_url( admin_url() ),
-                        'ajax'     =&gt; esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
-                ),
-                'settings' =&gt; array(),
-                'controls' =&gt; array(),
-        );
-
-        foreach ( $this-&gt;settings as $id =&gt; $setting ) {
-                $settings['settings'][ $id ] = array(
-                        'value'     =&gt; $setting-&gt;js_value(),
-                        'transport' =&gt; $setting-&gt;transport,
-                );
-        }
-
-        foreach ( $this-&gt;controls as $id =&gt; $control ) {
-                $control-&gt;to_json();
-                $settings['controls'][ $id ] = $control-&gt;json;
-        }
-
-        ?&gt;
-        &lt;script type=&quot;text/javascript&quot;&gt;
-                var _wpCustomizeSettings = &lt;?php echo json_encode( $settings ); ?&gt;;
-        &lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (20851 => 20852)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2012-05-23 15:36:27 UTC (rev 20851)
+++ trunk/wp-includes/theme.php        2012-05-23 17:56:42 UTC (rev 20852)
</span><span class="lines">@@ -1566,7 +1566,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Includes and instantiates the WP_Customize class.
</del><ins>+ * Includes and instantiates the WP_Customize_Manager class.
</ins><span class="cx">  *
</span><span class="cx">  * Fires when ?customize=on.
</span><span class="cx">  *
</span><span class="lines">@@ -1574,12 +1574,12 @@
</span><span class="cx">  */
</span><span class="cx"> function _wp_customize_include() {
</span><span class="cx">         // Load on themes.php or ?customize=on
</span><del>-        if ( ! ( isset( $_REQUEST['customize'] ) &amp;&amp; 'on' == $_REQUEST['customize'] ) )
</del><ins>+        if ( ! ( ( isset( $_REQUEST['customize'] ) &amp;&amp; 'on' == $_REQUEST['customize'] ) || 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><del>-        require( ABSPATH . WPINC . '/class-wp-customize.php' );
</del><ins>+        require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
</ins><span class="cx">         // Init Customize class
</span><del>-        $GLOBALS['wp_customize'] = new WP_Customize;
</del><ins>+        $GLOBALS['wp_customize'] = new WP_Customize_Manager;
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'plugins_loaded', '_wp_customize_include' );
</span><span class="cx"> 
</span><span class="lines">@@ -1604,5 +1604,5 @@
</span><span class="cx">  * @since 3.4.0
</span><span class="cx">  */
</span><span class="cx"> function wp_customize_url( $stylesheet ) {
</span><del>-        return esc_url( admin_url( 'admin.php' ) . '?customize=on&amp;theme=' . $stylesheet );
</del><ins>+        return esc_url( admin_url( 'customize.php' ) . '?theme=' . $stylesheet );
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>