WPThemeReview
WPThemeReview copied to clipboard
Dissallow hiding or removing the themes section of the customizer
The theme section in the customizer shows the name of the active theme and the Change button where the user can preview and select another theme. By hiding or removing the section authors can lock users in.
Rule type:
Error
Rule:
Currently not in the handbook.
[Optional Section] Decision needed:
We have allowed users to move and in some exceptions, remove existing sections, but I feel that this needs to be an exception.
Notes for implementation:
Examples:
#customize-theme-controls .control-section-themes {
display: none !important;
}
Removing:
$wp_customize->remove_section( 'themes' );
$wp_customize->remove_control( 'active_theme' );
Moving:
$wp_customize->get_control( 'active_theme' )->section = 'new_section_name';
To do:
- [ ] Add the rule in the Theme Review handbook to the Requirements page.
- [ ] Create unit tests
- [ ] Create new sniff
See branch issue-127-removing-customizer-active-theme It does not cover display: none
I've assigned this for a later release, since we are lacking decision on this.
I'll vote for not allowing changing the themes section.
I'd agree too that themes shouldn't remove the theme switcher functionality. In watching new users, I've seen a lot of people who use the switching functionality in the customizer as the "normal" way of switching their themes(and discovering new ones), and not rely so much on the dashboard.
There doesn't really need to be any further discussion on this. This falls under the universal "Don't be a d***" guideline. I don't think there's anyone on the team that would be against having this in.
On the other hand I have only seen this happen once. It might not be worth the effort.
Perhaps a more general warning for $wp_customize->remove_section $wp_customize->remove_control
Triage resolution: We should add this as a sniff. The handbook should also be updated (there are parts with No removing or modifying non-presentational hooks
, so no removing of the themes section can be added there).