Make WordPress Core

Opened 2 years ago

Closed 18 months ago

Last modified 17 months ago

#26662 closed enhancement (duplicate)

Menus: have main menu assignment persist between theme switches

Reported by: kwight 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 primary and assign it to the new theme's primary location
  • If there's no primary location but only one location in the new theme, assign the original location to the only new theme location
  • If there's no primary location but many menus, assign it to the first in the array of registered menus

Change History (5)

#1 @SergeyBiryukov
2 years ago

  • Version changed from trunk to 3.8

Related: #17979 (for widgets).

#2 @lancewillett
2 years ago

  • Cc lancewillett added
  • Keywords needs-patch added

#3 @iandstewart
2 years ago

  • Cc iandstewart added

#4 @celloexpressions
18 months ago

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #18588, although the title and description here are a bit clearer.

#5 @SergeyBiryukov
17 months ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.