Make WordPress Core

Opened 9 years ago

Last modified 4 months ago

#31593 new defect (bug)

Conflict of custom post type menu and add_utility_page

Reported by: inc2734's profile 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)

#1 follow-up: @DrewAPicture
9 years ago

Seems like a duplicate of #18622 which is currently marked as a duplicate of #16856, though I'm not sure I agree with that.

#2 in reply to: ↑ 1 @inc2734
9 years ago

Replying to DrewAPicture:

Seems like a duplicate of #18622 which is currently marked as a duplicate of #16856, though I'm not sure I agree with that.

I haven't known this tickets. thank you!

#3 @SergeyBiryukov
9 years ago

  • Component changed from Menus to Administration

Related: #23108

Note: See TracTickets for help on using tickets.