WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#18622 closed defect (bug) (duplicate)

register_post_type menu_position conflict with add_menu_page

Reported by: lambje Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Menus Keywords:
Focuses: Cc:

Description (last modified by scribu)

Today I was apprised of an issue where my plugin's menu was not being displayed in the Admin sidebar nav. My plugin is "WEBphysiology Portfolio". The menus are initially set by specifying

menu_position => 5

during the register_post_type call. This has been placing it right below the Posts menu section. The register_post_type function is being called during "init".

The conflict found today was with the plugin "W4 Post List". They setup their Admin plugin menus by using the add_menu_page function and they specify a position of '6' (with single quotes). When I changed this to '7' it shifted down, allowing my plugin's menu to appear.

This is rather frustrating and really should be handled by the code that builds out the menu, such that two menus cannot be positioned in the same location.

I don't think this is a duplicate of ticket #16856 but noting that ticket just the same.

Change History (2)

comment:1 scribu3 years ago

  • Description modified (diff)

comment:2 scribu3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

It's not an exact duplicate, but it's very very close and the code to fix it would surely be related.

Therefore, I think it's better if all discussion happens in one place, namely #16856.

Note: See TracTickets for help on using tickets.