have main menu assignment persist between theme switches) – WordPress Trac (original) (raw)
#26662 closed enhancement (duplicate)
| Reported by: | |
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.8 |
| Component: | Menus | Keywords: | |
| Focuses: | Cc: |
When a user switches to a new (never before used) theme, can we somehow assign their previous main menu to the new theme's main location? If we were to standardize on a register_nav_menu location key (say, primary), shouldn't we be able to:
- Check if the new theme has a location called
primary - If a menu is already assigned, use that one (the case when a user switches back to a previously used theme)
- If not, take the last theme's menu assigned to
primaryand assign it to the new theme'sprimarylocation - If there's no
primarylocation but only one location in the new theme, assign the original location to the only new theme location - If there's no
primarylocation but many menus, assign it to the first in the array of registered menus