Theme Customizer: Display 'Save and Activate' when switching themes. Add and properties to the WP_Customize class. see #19910.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2012-04-17 20:49:39 +00:00
parent d8778f9518
commit 565300e1cd
2 changed files with 8 additions and 1 deletions

View File

@ -10,6 +10,9 @@
final class WP_Customize {
protected $template;
protected $stylesheet;
protected $original_template;
protected $original_stylesheet;
protected $previewing = false;
protected $settings = array();
@ -81,6 +84,9 @@ final class WP_Customize {
show_admin_bar( false );
$this->original_template = get_template();
$this->original_stylesheet = get_stylesheet();
add_filter( 'template', array( $this, 'get_template' ) );
add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );

View File

@ -81,7 +81,8 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-footer-actions" class="customize-section wp-full-overlay-footer">
<?php
submit_button( __( 'Save' ), 'primary', 'save', false );
$save_text = $this->get_stylesheet() == $this->original_stylesheet ? __('Save') : __('Save and Activate');
submit_button( $save_text, 'primary', 'save', false );
?>
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>