Make WordPress Core

Ticket #28550: 28550.diff

File 28550.diff, 3.1 KB (added by westonruter, 9 years ago)

Only include theme customize-info if doing Live Preview theme switch. See changes without whitespace differences: https://github.com/x-team/wordpress-develop/commit/159948664a5981bb3af8d500feb7fcff435f13fe?w=1 Part of PR on GitHub: https://github.com/x-team/wordpress-develop/pull/18

  • src/wp-admin/customize.php

    diff --git src/wp-admin/customize.php src/wp-admin/customize.php
    index 1faf371..5668a76 100644
    do_action( 'customize_controls_print_scripts' ); 
    113113                        </a>
    114114                </div>
    115115
    116                 <?php
    117                         $screenshot = $wp_customize->theme()->get_screenshot();
    118                         $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
    119                 ?>
    120 
    121116                <div id="widgets-right"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the customizer for compat -->
    122117                <div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1">
    123                         <div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
    124                                 <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
    125                                         <span class="preview-notice"><?php
    126                                                 /* translators: %s is the theme name in the Customize/Live Preview pane */
    127                                                 echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
    128                                         ?></span>
    129                                 </div>
    130                                 <?php if ( ! $cannot_expand ) : ?>
    131                                 <div class="accordion-section-content">
    132                                         <?php if ( $screenshot ) : ?>
    133                                                 <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
    134                                         <?php endif; ?>
    135 
    136                                         <?php if ( $wp_customize->theme()->get('Description') ): ?>
    137                                                 <div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
     118                        <?php if ( ! $wp_customize->is_theme_active() ): ?>
     119                                <?php
     120                                $screenshot = $wp_customize->theme()->get_screenshot();
     121                                $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get( 'Description' ) );
     122                                ?>
     123                                <div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) { echo ' cannot-expand'; } ?>">
     124                                        <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
     125                                                <span class="preview-notice"><?php
     126                                                        /* translators: %s is the theme name in the Customize/Live Preview pane */
     127                                                        echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display( 'Name' ) . '</strong>' );
     128                                                ?></span>
     129                                        </div>
     130                                        <?php if ( ! $cannot_expand ) : ?>
     131                                        <div class="accordion-section-content">
     132                                                <?php if ( $screenshot ) : ?>
     133                                                        <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
     134                                                <?php endif; ?>
     135
     136                                                <?php if ( $wp_customize->theme()->get( 'Description' ) ): ?>
     137                                                        <div class="theme-description"><?php echo $wp_customize->theme()->display( 'Description' ); ?></div>
     138                                                <?php endif; ?>
     139                                        </div>
    138140                                        <?php endif; ?>
    139141                                </div>
    140                                 <?php endif; ?>
    141                         </div>
     142                        <?php endif; ?>
    142143
    143144                        <div id="customize-theme-controls"><ul>
    144145                                <?php
    145                                 foreach ( $wp_customize->sections() as $section )
     146                                foreach ( $wp_customize->sections() as $section ) {
    146147                                        $section->maybe_render();
     148                                }
    147149                                ?>
    148150                        </ul></div>
    149151                </div>