Opened 8 years ago
Last modified 3 years ago
#38967 new defect (bug)
Customizer display Menus, although the theme not support menus
Reported by: | elisa-demonki | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Customize | Keywords: | needs-patch has-screenshots |
Focuses: | Cc: |
Description
The Customizer display the panel Menus, although the theme not support widgets or menus.
Attachments (1)
Change History (9)
#1
@
8 years ago
Hey there,
Thanks for your report and welcome to WordPress Trac! Please note that menus can also be used in widgets. Theme do not need to add support for menus in order for you to use that functionality.
#2
@
8 years ago
- Severity changed from normal to minor
Thank you Swissspidy :)
Yes, the theme do not support widgets, too. (Menus are correct not display in admin menu.)
This ticket was mentioned in Slack in #core by helen. View the logs.
8 years ago
#5
@
8 years ago
- Keywords reporter-feedback added
Hi @elisa-demonki - is this new to 4.7 or has it been this way for a while?
#6
@
8 years ago
- Keywords needs-patch added; reporter-feedback removed
- Milestone changed from Awaiting Review to Future Release
- Version changed from trunk to 3.9
@elisa-demonki I just checked in 4.6 and the issue is there as well. The WP_Customize_Widgets
and WP_Customize_Nav_Menus
classes need to be checking for widgets
and nav-menus
theme support respectively before they start adding their extensions. Note that the constructors for each will need to be carefully refactored to move hooks to a later point when after_setup_theme
is called. Either this, or at the very least the active_callback
can at the very last moment return false
for these two panels if the theme support is not present. But it would seem preferable to short-circuit the components entirely when possible.
@elisa-demonki For the time being, you can add a plugin (not in your theme, which is loaded too late) which short-circuits these components from being loaded by doing:
<?php add_filter( 'customize_loaded_components', function( $components ) { return array_filter( $components, function( $component ) { return 'widgets' !== $component && 'nav_menus' !== $component; } ); } );
This filter was introduced in #33552.
customize-display-menus