Theme Customizer: Properly change state when theme is switched. fixes #20610, see #19910.

* Causes the Manage Themes page to refresh if the customizer is closed after the active theme is switched.
* Changes the text of the 'Save and Activate' button once the theme has been activated.
* Improves the naming of the customize control settings.
* Add events to customize.Loader and make callbacks more flexible.
* Makes the customize-loader l10n compatible with non-admin settings.
* Adds WP_Customize->is_current_theme_active().
* Minor style corrections, including jQuery.attr/prop changes.



git-svn-id: https://develop.svn.wordpress.org/trunk@20802 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-05-16 05:55:54 +00:00
parent 47d5d564b4
commit 5c77fcc30b
8 changed files with 133 additions and 36 deletions

View File

@@ -76,7 +76,7 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-footer-actions" class="wp-full-overlay-footer">
<?php
$save_text = $this->get_stylesheet() == $this->original_stylesheet ? __('Save') : __('Save and Activate');
$save_text = $this->is_current_theme_active() ? __('Save') : __('Save and Activate');
submit_button( $save_text, 'primary', 'save', false );
?>
<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" />
@@ -93,12 +93,17 @@ do_action( 'customize_controls_print_scripts' );
do_action( 'customize_controls_print_footer_scripts' );
$settings = array(
'theme' => $this->get_stylesheet(),
'preview' => esc_url( home_url( '/' ) ),
'theme' => array(
'stylesheet' => $this->get_stylesheet(),
'active' => $this->is_current_theme_active(),
),
'url' => array(
'preview' => esc_url( home_url( '/' ) ),
'parent' => esc_url( admin_url() ),
'ajax' => esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
),
'settings' => array(),
'controls' => array(),
'parent' => esc_url( admin_url() ),
'ajax' => esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
);
foreach ( $this->settings as $id => $setting ) {