Customizer Theme Switcher: Navigation streamlining.

* Detach Themes section from other controls
* Move to buttons to navigate back and forth
* Change titles based on current theme status, active/previewing
* Hide the active/previewing theme from the list of available themes

props folletto for the design concepts.
props designsimply, celloexpressions for initial patches.
props Team Gandalf.
see #31289.

git-svn-id: https://develop.svn.wordpress.org/trunk@31975 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2015-04-01 22:50:10 +00:00
parent d6a590e087
commit a05bbf7e7b
4 changed files with 89 additions and 75 deletions
@@ -1148,9 +1148,9 @@ final class WP_Customize_Manager {
/* Themes */
$this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array(
'title' => sprintf( __( 'Theme: %s' ), $this->theme()->display('Name') ),
'title' => $this->theme()->display( 'Name' ),
'capability' => 'switch_themes',
'priority' => 0,
'priority' => 0,
) ) );
// Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience).
@@ -1163,10 +1163,14 @@ final class WP_Customize_Manager {
// Theme Controls.
$themes = wp_prepare_themes_for_js();
foreach ( $themes as $theme ) {
if ( $theme['active'] ) {
continue;
}
$theme_id = 'theme_' . $theme['id'];
$this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array(
'theme' => $theme,
'section' => 'themes',
'theme' => $theme,
'section' => 'themes',
'settings' => 'active_theme',
) ) );
}