diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
index f8bab30..46ff8c7 100644
|
|
final class WP_Customize_Manager { |
1686 | 1686 | |
1687 | 1687 | /* Themes */ |
1688 | 1688 | |
1689 | | $this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array( |
| 1689 | $themes_section = new WP_Customize_Themes_Section( $this, 'themes', array( |
1690 | 1690 | 'title' => $this->theme()->display( 'Name' ), |
1691 | 1691 | 'capability' => 'switch_themes', |
1692 | 1692 | 'priority' => 0, |
1693 | | ) ) ); |
| 1693 | ) ); |
| 1694 | $this->add_section( $themes_section ); |
1694 | 1695 | |
1695 | 1696 | // Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience). |
1696 | 1697 | $this->add_setting( new WP_Customize_Filter_Setting( $this, 'active_theme', array( |
… |
… |
final class WP_Customize_Manager { |
1728 | 1729 | ) ) ); |
1729 | 1730 | } |
1730 | 1731 | |
| 1732 | $themes_section->theme_count = count( $themes ); |
| 1733 | |
1731 | 1734 | /* Site Identity */ |
1732 | 1735 | |
1733 | 1736 | $this->add_section( 'title_tagline', array( |
diff --git src/wp-includes/customize/class-wp-customize-themes-section.php src/wp-includes/customize/class-wp-customize-themes-section.php
index ecd7833..a2d0c65 100644
|
|
class WP_Customize_Themes_Section extends WP_Customize_Section { |
28 | 28 | public $type = 'themes'; |
29 | 29 | |
30 | 30 | /** |
| 31 | * Number of themes. |
| 32 | * |
| 33 | * If this less than 2, the Change button will not be displayed. |
| 34 | * |
| 35 | * @since 4.4.0 |
| 36 | * @access public |
| 37 | * @var int |
| 38 | */ |
| 39 | public $theme_count = 0; |
| 40 | |
| 41 | /** |
31 | 42 | * Render the themes section, which behaves like a panel. |
32 | 43 | * |
33 | 44 | * @since 4.2.0 |
… |
… |
class WP_Customize_Themes_Section extends WP_Customize_Section { |
46 | 57 | } |
47 | 58 | ?> |
48 | 59 | |
49 | | <button type="button" class="button change-theme" tabindex="0"><?php _ex( 'Change', 'theme' ); ?></button> |
| 60 | <?php if ( $this->theme_count > 1 ) : ?> |
| 61 | <button type="button" class="button change-theme" tabindex="0"><?php _ex( 'Change', 'theme' ); ?></button> |
| 62 | <?php endif; ?> |
50 | 63 | </h3> |
51 | 64 | <div class="customize-themes-panel control-panel-content themes-php"> |
52 | 65 | <h3 class="accordion-section-title customize-section-title"> |