Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#9047 closed defect (bug) (fixed)

add_object_page Limit, adding more than 13 and you start to lose the core menu

Reported by: sc0ttkclark Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: UI Keywords: needs-patch
Focuses: Cc:
PR Number:


I've done some testing with the function add_object_page

You start out with 5 object pages in a fresh install of WordPress.

With certain plugins adding add_object_page, specifically ones giving more CMS functionality with custom content types (past Posts and Pages), there are issues when this function is called a certain number of times. You begin to lose the core menu from below. When I say lose, I mean, the gap between the two sections, the add_object_page section and the add_utility_page section.

Below are my findings after testing the limits, and keep in mind these numbers are not including the original 5 core menu items (Posts, Media, Links, Pages, Comments):

at 14 you lose the Appearance menu item (and the separator between the object and utility menu sections)
at 19 you lose the Plugins menu item
at 24 you lose the Users menu item

I could go on further, but you get the picture. These menu items should never disappear no matter how many object pages are added.

Change History (4)

#1 @Denis-de-Bernardy
11 years ago

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

Unless I'm mistaking, this is because of the way admin menus are keyed. It's numerical, so if you insert too many top level items you will lose the default ones indeed.

Closing as invalid. The plugin developer should make sure he's not overwriting existing WP menu items, and re-index them as necessary.

#2 @DD32
11 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Yes, its due to the way that WP numbers its menu system.

No, It is not a good idea to expect plugin devs to re-index that array, afterall, their pluygin may only add 1 item. The API for adding them (add_object_page()) shouldbt be clobbering them in the first place.

#3 @sc0ttkclark
11 years ago

  • Milestone changed from 2.9 to 2.8

Exactly, the add_object_page function should handle the renumbering. I'm setting the milestone to 2.8 since this shouldn't take long to fix (for the appropriate developer), I'd set it to 2.7.1 if it wasn't already late on it's milestone deadline.

#4 @ryan
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10568]) Add more places between menu groups in the top-level menu array. fixes #9047

Note: See TracTickets for help on using tickets.