#34549 closed defect (bug) (fixed)
Theme Customizer: Disable "Change [theme]" button when only one theme available
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | Cc: |
Attachments (4)
Change History (12)
#1
@
8 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 4.4
- Owner set to westonruter
- Status changed from new to accepted
- Version set to 4.2
#2
@
8 years ago
My initial thought would be to just hide the "Change" button: 34549.2.diff
However, I'm not opposed to hiding the theme section entirely. It's a little bit inconsistent if you've gone from multiple themes to one, but I think that's edge case behavior.
#3
@
8 years ago
If I only have one theme, I already know what what it is and I don't need to be told. It just kinda wastes space.
Note in 34549.2.diff if that approach is taken, we should avoid calling wp_prepare_themes_for_js()
a second time in there because if there are a lot of themes (e.g. on WordPress.com) this can be very slow.
#4
@
8 years ago
- Keywords commit added
34549.3.diff follows down @danielbachhuber's approach in 34549.2.diff, but improves efficiency by setting a new $theme_count
property on WP_Customize_Themes_Section
.
#5
@
8 years ago
Actually, silly me, we can just use count( $this->controls )
to determine how many themes are added. See 34549.4.diff.
In a future release we can decided whether the themes section itself should be hidden entirely if there is only one available theme.
@danielbachhuber Good call. Please test 34549.diff.
The alternative would be to just not add the themes section or theme controls at all.