Make WordPress Core


Ignore:
Timestamp:
07/08/2014 07:52:17 PM (11 years ago)
Author:
helen
Message:

Customizer info section:

  • Only show the theme info when doing a live preview of another theme.
  • Replace with helper text about what you are customizing and what the Customizer is for.
  • Fix focus styling.

props celloexpressions, westonruter. fixes #28550.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r29031 r29034  
    120120        <?php
    121121            $screenshot = $wp_customize->theme()->get_screenshot();
    122             $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
     122            $cannot_expand = ! ( $wp_customize->is_theme_active() || $screenshot || $wp_customize->theme()->get('Description') );
    123123        ?>
    124124
     
    128128                <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
    129129                    <span class="preview-notice"><?php
    130                         /* translators: %s is the theme name in the Customize/Live Preview pane */
    131                         echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
     130                        if ( ! $wp_customize->is_theme_active() ) {
     131                            /* translators: %s is the theme name in the Customize/Live Preview pane */
     132                            echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
     133                        } else {
     134                            /* translators: %s is the site title in the Customize pane */
     135                            echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );
     136                        }
    132137                    ?></span>
    133138                </div>
    134139                <?php if ( ! $cannot_expand ) : ?>
    135140                <div class="accordion-section-content">
    136                     <?php if ( $screenshot ) : ?>
    137                         <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
    138                     <?php endif; ?>
    139 
    140                     <?php if ( $wp_customize->theme()->get('Description') ): ?>
    141                         <div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
    142                     <?php endif; ?>
     141                    <?php if ( ! $wp_customize->is_theme_active() ) :
     142                        if ( $screenshot ) : ?>
     143                            <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
     144                        <?php endif; ?>
     145
     146                        <?php if ( $wp_customize->theme()->get('Description') ): ?>
     147                            <div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
     148                        <?php endif;
     149                    else:
     150                        echo __( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' );
     151                    endif; ?>
    143152                </div>
    144153                <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.