Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#35081 closed defect (bug) (fixed)

Missing Change Theme button when there are only two themes available

Reported by: igmoweb Owned by: westonruter
Priority: normal Milestone: 4.4.1
Component: Customize Version: 4.4
Severity: normal Keywords: commit fixed-major
Cc: Focuses:

Description

When you have two themes in your installation, Change Theme button in Customizer is missing. I guess this is not a expected behavior, isn't it?

My thoughts:

It looks like in class-wp-customize-themes-section.php, line no. 49:

if ( count( $this->controls ) > 1 )

$this->controls does not include the current theme in the list. So there are two easy approaches for this:

  • Make the condition "> 0"
  • Add the current theme as a control in class-wp-customize-manager.php

Bear in mind that in a multisite, you want to display the network activated Themes, not all the themes, just in case something extra is needed for this fix in a Multisite

Attachments (1)

35081.diff​ (653 bytes ) - added by westonruter 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @westonruter
11 years ago

  • Milestone Awaiting Review → 4.4.1
  • Owner set to westonruter
  • Status new → accepted

See #34549 for where this was originally introduced.

#2 @westonruter
11 years ago

  • Keywords commit added

@igmoweb you're right. In fact a bit lower in the theme it even indicates that > 0 should have been used because it adds one to the number of controls:

<span class="title-count theme-count"><?php echo count( $this->controls ) + 1 /* Active theme */; ?></span>

#3 @westonruter
11 years ago

  • Resolution → fixed
  • Status accepted → closed

In 35943:

Customize: Ensure that "Change" button appears when there are only 2 themes.

Fixes defect introduced in [35535].

Props igmoweb.
See #34549.
Fixes #35081.

#4 @westonruter
11 years ago

  • Keywords fixed-major added

#5 @SergeyBiryukov
11 years ago

  • Resolution fixed
  • Status closed → reopened

Reopening for 4.4.1 consideration.

#6 @johnbillion
11 years ago

  • Version trunk → 4.4

#7 @dd32
11 years ago

  • Resolution → fixed
  • Status reopened → closed

In 36065:

Customize: Ensure that "Change" button appears when there are only 2 themes.

Fixes defect introduced in [35535].

Merges [35943] to the 4.4 branch.
Props igmoweb.
See #34549.
Fixes #35081.

Note: See TracTickets for help on using tickets.