#54418 closed defect (bug) (fixed)
Admin menu sidebar: Customizer menu item is not visible when a classic theme is active
Reported by: | poena | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 5.9 | Priority: | high |
Severity: | normal | Version: | 5.9 |
Component: | Administration | Keywords: | has-patch commit |
Focuses: | ui | Cc: |
Description (last modified by )
When a classic, php based theme without support for full site editing is active,
the customizer menu item is not visible in the WordPress admin sidebar menu.
It is still visible in the top bar on the front of the website, when a user with enough privileges is logged in.
I believe the intention was to only hide this menu item when a theme with support for full site editing is active.
(This is without and with Gutenberg 11.9 active)
Attachments (7)
Change History (24)
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
3 years ago
#3
@
3 years ago
- Keywords reporter-feedback added
Looks like the current check in trunk
is wp_is_block_template_theme
, which checks that a theme has a readable file at "[theme-path]/block-templates/index.html". See https://build.trac.wordpress.org/browser/trunk/wp-admin/menu.php#L219
@poena Does your current theme have this file?
#4
@
3 years ago
I tried several of the older default themes, and they do not have this file.
Can we confirm that we are looking at the same version?
I tested again with trunk at Changeset 51737 (latest git commit being [74df751]).
Is this not the correct version to test against?
Theme:
https://build.trac.wordpress.org/browser/trunk/wp-content/themes/twentynineteen
https://build.trac.wordpress.org/browser/trunk/wp-content/themes/twentytwenty
#5
@
3 years ago
- Keywords needs-patch added; reporter-feedback removed
Customize is not in the admin menu because the priority was moved from 6 to 7 (changeset 52069). In wp_widgets_add_menu
, the Widgets link is set to 7. Instead of pushing both Customize and Widgets links down for everyone, the Site Editor might be better at a priority of 8 (if you specifically want both Customize and Site Editor with your block theme, having Customize come first can make sense).
Customize is also missing from the toolbar, and I have not found the reason for that yet. (The toolbar link is fine; I forgot it only shows on the front end.)
This ticket was mentioned in Slack in #core by sabernhardt. View the logs.
3 years ago
@
3 years ago
Test Results: Can reproduce (Before). Patch 54418.diff restores the Customize menu to its original position (After).
@
3 years ago
Test Report: After applying 54418.diff => Customize menu is restored and shows for all themes except TT2
@
3 years ago
Test Report: TT2 with a callback to 'customize_register'
does show the Customize menu.
#9
@
3 years ago
- Keywords has-patch added; needs-patch removed
Test Report
Env:
- WordPress: latest
trunk
at time of this report (5.9-alpha) - Plugins: none
- Theme: switched between TT2, TT1, TT0, and Twenty Nineteen
- OS: macOS Big Sur
- Browser: Chrome, Firefox, Safari, and Edge
Steps
Steps to reproduce:
- Pull the latest
trunk
version (or use Beta Tester plugin) - Activate TT2. Notice the Customize menu does not display under "Appearance"
- Activate TT1. Customize menu should display under "Appearance", but it does not.
- Repeat with other bundled themes. Same result.
After applying 54418.diff:
- Activate TT2. Customize menu should not display.
- Activate TT1. Customize menu should display under "Appearance".
- Repeat with other bundled themes. Customize menu should display.
Results
I can able to reproduce the reported issue. The Customize menu item does not display for any themes.
When applying 54418.diff:
- With TT2, works as expected, i.e. Customize menu does not display ✅
- With TT1, menu is restored as it was in 5.8 ✅
- With Twenty Twenty, menu is restored ✅
- With Twenty Nineteen, menu is restored ✅
Can a block template theme also show the Customize menu?
Steps to Test:
- Activate TT2
- Add temporary testing code in the theme's
functions.php
file:/** * For testing purposes, add a callback to show the Customize * menu in position 7 in a block template theme. */ add_action( 'customize_register', '__return_true' );
- Refresh the browser. Notice the Customize menu item displayed below the "Editor" menu item.
Results:
Yes, a block template theme like TT2 can show the Customize menu when there's a callback registered to 'customize_register'
. Works as expected ✅
#10
@
3 years ago
- Keywords commit added
What's so special about position 7 in the Appearance sidebar menu?
Investigation:
- Confirmed the
Customize
menu item is being added at position 7 after [52069]. That code works. - Changed the position to 8, which also works.
- With 5.8.2, changed the Customize menu position from 6 to 7. Nope, it does not display.
- With 5.8.2, changed the Themes menu position from 5 to 7. Nope, it does not display either. What?!
Conclusions:
- The problem is not due to [52069].
- Something in the codebase is removing (not hiding, literally removing) any Appearance submenu item from position 7.
- Finding it will likely take time and patience to go down the rabbit hole.
- I think this is a separate issue that deserves its own ticket.
What about this ticket and patch?
Themes without a /block-templates/index.html
file show the Customizer menu item by default. Any plugin or theme that expects it in that position (for customization, relocating, or removal) will be impacted with this position change. That can be considered a breaking change.
I think restoring the original position makes sense. Marking for commit
.
#11
follow-up:
↓ 12
@
3 years ago
The Widgets link for non-block themes, added with the _admin_menu
action in wp-includes/functions.php, has had position number 7 for more than 14 years and refuses to budge :)
Also, block themes have a "Styles" link at menu position 7 now (r52158). An activated Customize link at 7 would replace Styles, so that needs to be higher/later. (Still restore the default number to 6.)
#12
in reply to:
↑ 11
@
3 years ago
Replying to sabernhardt:
Also, block themes have a "Styles" link at menu position 7 now (r52158). An activated Customize link at 7 would replace Styles, so that needs to be higher/later. (Still restore the default number to 6.)
@sabernhardt can you open a new ticket for this, i.e. to address the menu position of Customize with a block theme?
Why? This ticket and its patch are specifically to restore the menu position for non-block themes.
Thanks!
#13
follow-up:
↓ 15
@
3 years ago
I added another patch in case it's simple enough to fix the two issues together.
If you would rather commit the first patch, however, I could open a separate ticket after the commit.
#14
@
3 years ago
- Owner set to hellofromTonya
- Status changed from new to reviewing
Preparing commit.
#15
in reply to:
↑ 13
@
3 years ago
Replying to sabernhardt:
I added another patch in case it's simple enough to fix the two issues together.
If you would rather commit the first patch, however, I could open a separate ticket after the commit.
I think you're right @sabernhardt. Going to commit your patch. Thanks!
#17
@
3 years ago
Thank you everyone for contributing! 54418.position8.diff has been committed and will ship in tomorrow's 5.9 Beta 1.
Missing customize menu item under Appearance