Custom Post Type Menus

You got it right but you need to wait for WordPress 3.1 where its actually implemented. if you can’t wait you can change ‘show_in_menu’ to false and use add_submenu_page() function define ‘argus’ as top page and add the Visitors “manually” under Argus Admin menu.

so your code would be:

$v_args = array(
        'labels' => array (
                'name' => 'Visitors',
                'singular_name' => 'Visitor',
                'add_new_item' => 'Register New Visitor',
            ),
        'public' => true,
        'publicly_queryable' => false,
        'exclude_from_search' => true,
        'show_ui' => true,
        'show_in_menu' => 'flase',
        'hiearchical' => false,
        'supports' => array( '' ),
        'register_meta_box_cb' => array ( &$this, '_wp_visitor_meta_box_cb' ),
    );

    register_post_type( $post_type, $v_args );

and then

add_menu_page( 'Argus', 'Argus Admin', 'manage_options', 'argus', array( &$this, '_wp_argus_main_panel' ), '', -1 );
add_submenu_page( argus, 'Visitors', 'Visitors', 'manage_options' , 'visitors' , 'edit.php?post_type=visitors'); 

Hope this Helps

Leave a Comment