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:
parent
d8778f9518
commit
565300e1cd
|
@ -10,6 +10,9 @@
|
||||||
final class WP_Customize {
|
final class WP_Customize {
|
||||||
protected $template;
|
protected $template;
|
||||||
protected $stylesheet;
|
protected $stylesheet;
|
||||||
|
protected $original_template;
|
||||||
|
protected $original_stylesheet;
|
||||||
|
|
||||||
protected $previewing = false;
|
protected $previewing = false;
|
||||||
|
|
||||||
protected $settings = array();
|
protected $settings = array();
|
||||||
|
@ -81,6 +84,9 @@ final class WP_Customize {
|
||||||
|
|
||||||
show_admin_bar( false );
|
show_admin_bar( false );
|
||||||
|
|
||||||
|
$this->original_template = get_template();
|
||||||
|
$this->original_stylesheet = get_stylesheet();
|
||||||
|
|
||||||
add_filter( 'template', array( $this, 'get_template' ) );
|
add_filter( 'template', array( $this, 'get_template' ) );
|
||||||
add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
|
add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
|
||||||
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
|
add_filter( 'pre_option_current_theme', array( $this, 'current_theme' ) );
|
||||||
|
|
|
@ -81,7 +81,8 @@ do_action( 'customize_controls_print_scripts' );
|
||||||
|
|
||||||
<div id="customize-footer-actions" class="customize-section wp-full-overlay-footer">
|
<div id="customize-footer-actions" class="customize-section wp-full-overlay-footer">
|
||||||
<?php
|
<?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'); ?>">
|
<a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
|
||||||
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
|
<span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
|
||||||
|
|
Loading…
Reference in New Issue