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.

Built from https://develop.svn.wordpress.org/trunk@29034


git-svn-id: http://core.svn.wordpress.org/trunk@28822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí
2014-07-08 19:53:15 +00:00
parent 1e681c1421
commit c2a3f4fab5
7 changed files with 37 additions and 32 deletions

View File

@@ -119,7 +119,7 @@ do_action( 'customize_controls_print_scripts' );
<?php
$screenshot = $wp_customize->theme()->get_screenshot();
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
$cannot_expand = ! ( $wp_customize->is_theme_active() || $screenshot || $wp_customize->theme()->get('Description') );
?>
<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 -->
@@ -127,19 +127,28 @@ do_action( 'customize_controls_print_scripts' );
<div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
<div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
<span class="preview-notice"><?php
/* translators: %s is the theme name in the Customize/Live Preview pane */
echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
if ( ! $wp_customize->is_theme_active() ) {
/* translators: %s is the theme name in the Customize/Live Preview pane */
echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
} else {
/* translators: %s is the site title in the Customize pane */
echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );
}
?></span>
</div>
<?php if ( ! $cannot_expand ) : ?>
<div class="accordion-section-content">
<?php if ( $screenshot ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
<?php endif; ?>
<?php if ( ! $wp_customize->is_theme_active() ) :
if ( $screenshot ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
<?php endif; ?>
<?php if ( $wp_customize->theme()->get('Description') ): ?>
<div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
<?php endif; ?>
<?php if ( $wp_customize->theme()->get('Description') ): ?>
<div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
<?php endif;
else:
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.' );
endif; ?>
</div>
<?php endif; ?>
</div>