Move to admin.php?customize=on&theme=$stylesheet, rather than juggling both template and stylesheet values. see #19910.

Combine the setup_theme() and customize_previewing() methods. Remove the set_template() and set_stylesheet() methods. Add set_theme() method to WP_Customize to store the working WP_Theme object. We will use this for the stylesheet and template.

Use the WP_Theme display() method when preparing headers for display, not get() or the deprecate properties.



git-svn-id: https://develop.svn.wordpress.org/trunk@20496 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-04-17 21:43:47 +00:00
parent d6dc48bb27
commit bfae415dd9
3 changed files with 37 additions and 78 deletions
+6 -11
View File
@@ -27,16 +27,13 @@ wp_enqueue_style( 'customize-controls' );
do_action( 'customize_controls_enqueue_scripts' );
$theme = wp_get_theme();
$screenshot = $theme->get_screenshot();
// 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 — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $theme['Name'] ) ) );
$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $this->theme->display('Name') ) ) );
?><title><?php echo $admin_title; ?></title><?php
do_action( 'customize_controls_print_styles' );
@@ -47,9 +44,7 @@ do_action( 'customize_controls_print_scripts' );
<form id="customize-controls" method="post" class="wrap wp-full-overlay-sidebar" target="_parent" action="<?php echo esc_url( add_query_arg( 'save_customize_controls', '1', admin_url( 'themes.php' ) ) ); ?>">
<?php wp_nonce_field( 'customize_controls' ); ?>
<input type="hidden" name="customize" value="on" />
<input type="hidden" id="customize-template" name="template" value="<?php echo esc_attr( $theme['Template'] ); ?>" />
<input type="hidden" id="customize-stylesheet" name="stylesheet" value="<?php echo esc_attr( $theme['Stylesheet'] ); ?>" />
<input type="hidden" name="theme" value="<?php echo esc_attr( $this->get_stylesheet() ); ?>" />
<div id="customize-header-actions" class="customize-section wp-full-overlay-header">
<a class="back" href="<?php echo esc_url( admin_url( 'themes.php' ) ); ?>">
<?php printf( __( '&larr; Return to %s' ), __('Manage Themes') ); ?>
@@ -59,15 +54,15 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-info" class="customize-section">
<div class="customize-section-title">
<span class="preview-notice"><?php _e('You are previewing'); ?></span>
<strong class="theme-name"><?php echo $theme['Name']; ?></strong>
<strong class="theme-name"><?php echo $this->theme->display('Name'); ?></strong>
</div>
<div class="customize-section-content">
<?php if ( $screenshot ) : ?>
<?php if ( $screenshot = $this->theme->get_screenshot() ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
<?php endif; ?>
<?php if ( $theme->description ): ?>
<div class="theme-description"><?php echo $theme->description; ?></div>
<?php if ( $this->theme->get('Description') ): ?>
<div class="theme-description"><?php echo $this->theme->display('Description'); ?></div>
<?php endif; ?>
</div>
</div>