WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#35081 closed defect (bug) (fixed)

Missing Change Theme button when there are only two themes available

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

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 4 years ago.

Download all attachments as: .zip

Change History (8)

#1 @westonruter
4 years ago

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

See #34549 for where this was originally introduced.

@westonruter
4 years ago

#2 @westonruter
4 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
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to 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
4 years ago

  • Keywords fixed-major added

#5 @SergeyBiryukov
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.4.1 consideration.

#6 @johnbillion
4 years ago

  • Version changed from trunk to 4.4

#7 @dd32
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to 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.