I just recently upgraded to WordPress 3.1 a few moments ago. However, I noticed that when you have Post Types show up under a *main* menu page, it overrides the link fo th menu link.

Here's my register_post_type arguments for "Visitor" post type.

    $v_args = array(
        'labels' => array (
                'name' => 'Visitors',
                'singular_name' => 'Visitor',
                'add_new_item' => 'Register New Visitor', // TODO: http://codex.wordpress.org/Function_Reference/register_post_type#Arguments
        'public' => true,
        'publicly_queryable' => false,
        'exclude_from_search' => true,
        'show_ui' => true,
        'show_in_menu' => 'argus',
        //'show_in_menu' => false,
        'hiearchical' => false,
        'supports' => array( '' ),
        'capabilities' => $visitor_caps,
        'register_meta_box_cb' => array ( &$this, '_wp_visitor_meta_box_cb' ),

    // http://codex.wordpress.org/Function_Reference/register_post_type
    register_post_type( $post_type, $v_args );

Here is the call to add_menu_page that adds the link to the admin menu.

public function _wp_admin_menu( )
    add_menu_page( 'Argus', 'Argus Admin', 'argus', 'argus', array( &$this, '_wp_argus_main_panel' ), '', -1 );
    add_submenu_page( 'argus', 'Argus Administration', 'Main Menu', 'argus', 'argus', array( &$this, '_wp_argus_main_panel' ) );        
    // save having to register 'admin_menu' action across every sub-plugin
    // There is no 'admin_menu' function/method in any class stored in $classes
    foreach( self::$classes as $class => $obj )
        if ( method_exists( $obj, 'admin_menu' ) )

Please note: The call to add_submenu_page was added after the fact and doesn't change the behavior or output one bit. I added this to re-add the default link that 3.0.4 added by default under the link header generated by add_menu_page.

1 Answer 1


From the codex:

Note: When using 'some string' to show as a submenu of a menu page created by a plugin, this item will become the first submenu item, and replace the location of the top level link. If this isn't desired, the plugin that creates the menu page needs to set the add_action priority for admin_menu to 9 or lower.

So on you add_action('admin_menu',array($this,'_wp_admin_menu')); set priority to 9 or lower like so:


and you should be set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.