WordPress.org

Make WordPress Core

Ticket #34549: 34549.diff

File 34549.diff, 1.2 KB (added by westonruter, 5 years ago)
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 55acd10..857a8f6 100644
    final class WP_Customize_Manager { 
    16861686
    16871687                /* Themes */
    16881688
    1689                 $this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array(
     1689                $themes_section = new WP_Customize_Themes_Section( $this, 'themes', array(
    16901690                        'title'      => $this->theme()->display( 'Name' ),
    16911691                        'capability' => 'switch_themes',
    16921692                        'priority'   => 0,
    1693                 ) ) );
     1693                ) );
     1694                $this->add_section( $themes_section );
    16941695
    16951696                // Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience).
    16961697                $this->add_setting( new WP_Customize_Filter_Setting( $this, 'active_theme', array(
    final class WP_Customize_Manager { 
    17271728                                'settings' => 'active_theme',
    17281729                        ) ) );
    17291730                }
     1731                // Make the themes section inactive if there is only one theme on the site (since no switch can happen).
     1732                if ( count( $themes ) === 1 ) {
     1733                        $themes_section->active_callback = '__return_false';
     1734                }
    17301735
    17311736                /* Site Identity */
    17321737