#54888 closed defect (bug) (fixed)
Remove Customizer's Menus section when block theme is active.
Reported by: | hellofromTonya | Owned by: | |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | has-testing-info has-patch |
Focuses: | Cc: |
Description (last modified by )
When upgrading to 5.9 and first activating a block theme such as Twenty Twenty-Two (TT2), the Customizer's Menus section shows the existing (classic) menu(s) as though it is still assigned, but the previewer and Site Editor show the default header menu with pages listed (i.e. from the Navigation block with Page List).
This will confuse users.
How will they know that their previous (classic) menu needs to be assigned in the Site Editor when first upgrading? They won't.
To resolve this problem, @noisysocks suggested hiding the Menus section in Customizer as is done with the Widgets section.
Attachments (1)
Change History (14)
#1
@
3 years ago
- Keywords has-testing-info added
Steps to Reproduce:
- Start with pre 5.9 version, such as 5.8.3.
- Activate a default theme such as TT1 (Twenty Twenty-One).
- Add a Main Menu by going to Appearance > Menus and creating a menu and assign it to the primary menu.
- Open Customizer's Menu section by going to Appearance > Customize > Menus.
- Upgrade to 5.9 RC3.
- To upgrade, use either the Beta Tester plugin or wp cli (see instructions in RC3 release announcement).
- Activate TT2 (Twenty Twenty-Two) by going to Appearance > Themes.
- Refresh Customizer and then reopen Menus section.
Notice the preview is showing the default header nav of page listings, but the Menus section is still showing the previous assigned Main Menu.
- Open Site Editor.
- Open list view.
Notice the Navigation
block and Page List
. This is the default setup for TT2.
This ticket was mentioned in PR #2217 on WordPress/wordpress-develop by noisysocks.
3 years ago
#3
- Keywords has-patch added; needs-patch removed
By having WP_Customize_Panel::check_capabilities()
, we can ensure that the _Menus_ panel is removed if a theme does not have support for 'menus'
nor 'widgets'
. (We show the _Menus_ panel when there is support for 'widgets'
so that one can use the Menu widget.)
This ensures that the _Menus_ panel does not appear when using a block theme, which is pretty confusing, as the Navigation block is intended to be the sole place for editing a site's navigation when using a block theme.
Trac ticket: https://core.trac.wordpress.org/ticket/54888
#4
@
3 years ago
Test Report
Env
- WordPress 5.8.3 and PR 2217
- Chrome 97.0.4692.71
- Windows 10
- Theme: Twenty Twenty-One and Twenty Twenty-Two
- Block Editor
- Plugin: None activated
Steps to test block themes
- Start with pre 5.9 version, such as 5.8.3.
- Activate a default theme such as TT1 (Twenty Twenty-One).
- Add a Main Menu by going to
Appearance > Menus
and creating a menu and assign it to the primary menu. - Open Customizer's Menu section by going to
Appearance > Customize > Menus
. - Upgrade to 5.9 RC3.
- Activate TT2 (Twenty Twenty-Two) by going to
Appearance > Themes
. - Refresh
Customizer
and then reopenMenus
panel.
Notice the preview is showing the default header nav of page listings, but the Menus section is still showing the previous assigned Main Menu. ✅
- Apply PR 2217.
- Refresh
Customizer
. - The
Menus
panel is not shown. ✅
Steps to test classic themes
- Switch to Twenty Twenty-One.
- Comment out
register_nav_menus()
andregister_sidebar()
inwp-content/themes/twentytwentyone/functions.php
. - View
Customizer
. - The
Menus
panel is shown. ✅ - Apply PR 2217.
- Refresh
Customizer
. - The
Menus
panel is not shown. ✅
Results
PR 2217 successfully removes the Menus
panel from the Customizer for block themes and classic themes that do not support menus
or widgets
. ✅
noisysocks commented on PR #2217:
3 years ago
#5
Edit: Timing. Defer to you and Peter to discuss unneeded code vs consistency.
😅 I want the consistency but, yeah, safest to not fix what isn't broken while in RC. I'll open a seperate patch which adds it and we can commit that to trunk
only.
noisysocks commented on PR #2217:
3 years ago
#6
Thanks for reviewing and testing. Feedback addressed. I can commit to both branches today if two devs approve 😀
See the issue in action: Upgrade to 5.9, activate TT2, refresh Customizer and open Menus section, and open Site Editor. Notice: preview in Customizer is the page listing but Menus still shows classic menu.