Opened 15 years ago
Closed 15 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: |
Description
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
@
15 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
#2
@
15 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.
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.