Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 3 years ago

#5100 closed enhancement (invalid)

Allow top level's first submenu title to differ from top level menu's name

Reported by: Viper007Bond Owned by:
Milestone: Priority: low
Severity: minor Version: 2.3
Component: Administration Keywords:
Focuses: Cc:


If you create a top level menu and then a submenu page under it, a submenu page with the title of the top level menu is automatically created as the first tab. It'd be nice if this submenu's title could differ from that of top level menu (like the official menus do with "Options > General").

I was thinking a good way to do this would be to have the ability of add_menu_page()'s title vars to be arrays. However, I've discovered that the submenu is automatically created when the 2nd submenu is added, not when the top level menu is made.

So a few ideas, both of which revolve around my array idea.

The first is that add_menu_page() takes the extra titles set via the array and stores them for later usage. When the submenu is automatically created by add_submenu_page(), those titles are used.

The second is that add_menu_page() automatically creates a submenu page on it's own (with the code from add_submenu_page() removed), but when a top level menu only has one submenu item, the submenu bar is hidden.

Any thoughts on this proposal? Anyone have any better solutions?

Change History (6)

#1 @Viper007Bond
11 years ago

Oh, the purpose of arrays over new parameters is for backwards compatibility. The function would perform identically when the old string format was used, but if (is_array( ..., then these changes would take effect.

#2 follow-up: @DD32
10 years ago

Related: #4908 - add_menu_page() should be able to not made it's own sub-menu

#3 in reply to: ↑ 2 @Viper007Bond
10 years ago

Replying to DD32:

Related: #4908 - add_menu_page() should be able to not made it's own sub-menu

Whoops. Forgot I made a similar previous ticket.

#4 @ffemtcj
10 years ago

  • Milestone changed from 2.5 to 2.6

#5 @mrmist
10 years ago

  • Keywords needs-patch removed
  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Not really relevant any more.

Note: See TracTickets for help on using tickets.