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

git-svn-id: https://develop.svn.wordpress.org/trunk@20495 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-04-17 20:49:39 +00:00
parent 5028f1f6b0
commit d6dc48bb27
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>