How Do I Programmatically Better Organize Custom Post Type Menus?

On the function to register a new custom post type can you set this CPT as Submenu to a exist menu item. Use the param show_in_menu

A example:

register_post_type( 
    'issue', 
    apply_filters( 'wpit_register_issue_post_type', 
        array(
            'labels'          => $issue_labels,
            'rewrite'         => $issue_rewrite,
            'supports'        => $issue_supports,
            'taxonomies'      => $issue_taxonomies,
            'menu_position'   => 5,
            'public'          => TRUE,
            'show_ui'         => TRUE,
            'show_in_menu'    => 'edit.php',
            'can_export'      => TRUE,
            'capability_type' => 'post',
            'query_var'       => TRUE
        )
    ) 
);

You find the string for the items on mouse over, like upload.phpon the item Media.

Leave a Comment