Opened 15 years ago
Closed 15 years ago
#13787 closed defect (bug) (fixed)
Adding an empty menu object displays theme default menu instead
Reported by: | markel | Owned by: | |
---|---|---|---|
Milestone: | 3.0.1 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Tested in r15172:
A user can add a menu object without assigning any items to that menu (which appears to be a "blank" or "empty" menu). This empty menu can then be successfully assigned to one of the menu slots for a theme.
When viewing the site, instead of being empty, the default menu for the theme appears.
Users should either be able to assign an empty menu, in which case no items will appear, or not be able to assign a menu without items to one of the theme slots.
Attachments (1)
Change History (9)
#2
@
15 years ago
An empty menu should still be ignored if it isn't assigned to a location. But an empty menu assigned to a location should be respected as deliberate.
#3
@
15 years ago
This should allow for the following:
- If no location is set, use the fallback.
- If location is set to an empty menu, use the empty menu.
- If no menus exist, use the fallback.
- If location is somehow set to a non-existent menu, use the fallback.
#6
follow-up:
↓ 7
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This can create confusion when users accidentally create a new menu, or create a new menu and have it activated as their default menu by default.
I opened a ticket about this on the Themes trac, but it probably belongs here. See my notes on this issue there:
https://wpcom-themes.trac.automattic.com/ticket/442
Quoting:
When you create a new menu, it automatically becomes active as the default menu. This may be theme specific, but I checked this again with twentyten and Bueno on a new blog before posting this reply just to be sure. I believe this is the primary cause for "my menu disappeared" tickets, which are quite numerous. I may be missing something here, but I can't see what.
If removing the automatic menu generated by the theme is indeed a desired outcome (I believe it is), there should be a real option to do it. This option should be easily discoverable in a place a user is likely to look in, and it's functionality should be easily understandable so a user won't have to look in forums or help files to understand what it does. Right now, neither is true, and that's why I don't this is something we should expect users to figure out on their own.
I believe we treat an empty menu the same as a menu that doesn't exist. Worse, we don't abide by it in menu locations (you can assign literally no menu to a location, and it will work). The simple solution I think is that an empty menu should be a valid menu.