Theme Customizer: Don't expand theme title if there are no details to show. props nacin, fixes #20757, see #19910.

git-svn-id: https://develop.svn.wordpress.org/trunk@20940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-05-26 20:47:55 +00:00
parent 04bf106bc6
commit d0a638e2cb
3 changed files with 23 additions and 4 deletions

View File

@@ -60,14 +60,20 @@ do_action( 'customize_controls_print_scripts' );
</a>
</div>
<?php
$screenshot = $wp_customize->theme()->get_screenshot();
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
?>
<div class="wp-full-overlay-sidebar-content">
<div id="customize-info" class="customize-section">
<div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
<div class="customize-section-title">
<span class="preview-notice"><?php _e('You are previewing'); ?></span>
<strong class="theme-name"><?php echo $wp_customize->theme()->display('Name'); ?></strong>
</div>
<?php if ( ! $cannot_expand ) : ?>
<div class="customize-section-content">
<?php if ( $screenshot = $wp_customize->theme()->get_screenshot() ) : ?>
<?php if ( $screenshot ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
<?php endif; ?>
@@ -75,6 +81,7 @@ do_action( 'customize_controls_print_scripts' );
<div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<div id="customize-theme-controls"><ul>