WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 8 months ago

Last modified 7 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:

Description

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)

comment:1 @SergeyBiryukov15 months ago

  • Version changed from trunk to 3.8

Related: #17979 (for widgets).

comment:2 @lancewillett15 months ago

  • Cc lancewillett added
  • Keywords needs-patch added

comment:3 @iandstewart15 months ago

  • Cc iandstewart added

comment:4 @celloexpressions8 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.

comment:5 @SergeyBiryukov7 months ago

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