WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/01/2015 10:50:10 PM (6 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-section.php

    r31968 r31975  
    342342        ?>
    343343        <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
    344             <h3 class="accordion-section-title" tabindex="0">
    345                 <?php echo esc_html( $this->title ); ?>
    346                 <span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span>
     344            <h3 class="accordion-section-title">
     345                <?php
     346                if ( $this->manager->is_theme_active() ) {
     347                    /* translators: %s: theme name */
     348                    printf( __( '<span>Active theme</span> %s' ), $this->title );
     349                } else {
     350                    /* translators: %s: theme name */
     351                    printf( __( '<span>Previewing theme</span> %s' ), $this->title );
     352                }
     353                ?>
     354
     355                <button type="button" class="button change-theme"><?php _ex( 'Change', 'theme' ); ?></button>
    347356            </h3>
    348357            <div class="customize-themes-panel control-panel-content themes-php">
    349                 <h2><?php esc_html_e( 'Themes' ); ?>
    350                     <span class="title-count theme-count"><?php echo count( $this->controls ) - 1; ?></span>
     358                <h2>
     359                    <?php _e( 'Themes' ); ?>
     360                    <span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /* Active theme */; ?></span>
    351361                </h2>
     362
     363                <h3 class="accordion-section-title customize-section-title">
     364                    <?php
     365                    if ( $this->manager->is_theme_active() ) {
     366                        /* translators: %s: theme name */
     367                        printf( __( '<span>Active theme</span> %s' ), $this->title );
     368                    } else {
     369                        /* translators: %s: theme name */
     370                        printf( __( '<span>Previewing theme</span> %s' ), $this->title );
     371                    }
     372                    ?>
     373                    <button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button>
     374                </h3>
     375
    352376                <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div>
     377
    353378                <div id="customize-container"></div>
    354                 <?php if ( 6 < count( $this->controls ) ) : ?>
     379                <?php if ( count( $this->controls ) > 4 ) : ?>
    355380                    <p><label for="themes-filter">
    356381                        <span class="screen-reader-text"><?php _e( 'Search installed themes...' ); ?></span>
Note: See TracChangeset for help on using the changeset viewer.