Opened 10 years ago
Last modified 12 months ago
#31593 new defect (bug)
Conflict of custom post type menu and add_utility_page
Reported by: | inc2734 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1.1 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
I installed a plugin that register_post_type with menu_position 80. Thereafter, I installed a plugin to add a menu by add_utility_page. Then the menu of menu_position 80 is disappeared.
Where I examined, I think there is a problem with the count up of $_wp_last_utility_menu
, but is this correct specification?
This is the sample code.
function test_add_utility_page() { add_utility_page( 'test_utility_page', 'test_utility_page', 'edit_posts', 'test_utility_page', '__return_false' ); } add_action( 'admin_menu', 'test_add_utility_page' ); function test_register_post_type() { register_post_type( 'test_post_type', array( 'labels' => array( 'name' => 'test_post_type', ), 'public' => true, 'menu_position' => 80, ) ); } add_action( 'init', 'test_register_post_type' );
Change History (3)
Note: See
TracTickets for help on using
tickets.
Seems like a duplicate of #18622 which is currently marked as a duplicate of #16856, though I'm not sure I agree with that.