Top level admin sidebar menu items with conflicting positions bury one another
|Reported by:||beautomated||Owned by:||chriscct7|
|Component:||Plugins||Keywords:||has-patch commit needs-codex|
I have now seen two separate instances where a top level admin sidebar menu item wasn't showing up when another Plugin or Theme was activated. In the most recent case, using WP 3.5.1. my Plugin was creating a top level menu item with no position specified (blank, default). When I activated my client's Theme, our Plugin sidebar item disappeared and in place came the Theme Options item. I set our Plugin to use position 70, and it came back in place of the Users top level menu item.
In the earlier case, I had a custom post type that was requesting position 20. Whenever I activated Gravity Forms, my custom post type menu item was disappearing. This was with WordPress v3.5
According to the codex page: "WARNING: if two menu items use the same position attribute, one of the items may be overwritten so that only one item displays! Risk of conflict can be reduced by using decimal instead of integer values, e.g. 63.3 instead of 63 (Note: Use quotes in code, IE '63.3')."
This seems like a bug to me. Why should items be allowed to completely overwrite one another? Shouldn't they just fall in line, albeit randomly when two conflict? I can see tons of problems with Themes and Plugins killing one another's top level menu items, and the user not understanding what's going on when they loose something unexpectedly.
Change History (16)
15 months ago
- Milestone changed from Awaiting Review to 4.4
- Owner set to chriscct7
- Status changed from new to assigned
15 months ago
- Component changed from Administration to Plugins
- Focuses administration added
- Keywords commit added; dev-feedback removed