Question

I have created a college management menu in admin, under that i have added some sub menus those submenus are of different post types. Those were working fine. But Category and tags are not showing as sub-sub-menu under custom post types

College Management     /* Main menu */
 -- Faculty            /* Sub menu Custom post type */
 -- Courses            /* Sub menu Custom post type */
 -- News               /* Sub menu Custom post type */
    -- News Categories /* Sub Sub menu Custom post type Texonomy */
    -- News Tags       /* Sub Sub menu Custom post type Texonomy */
add_action('admin_menu', 'college_management_menu');

function college_management_menu() {
    add_menu_page('College Management', 'College Management', 'manage_options', 'college-management', 'college_management_callback_function', 'dashicons-building', 5);

    add_submenu_page('college-management', 'Stream', 'Stream', 'manage_options', 'edit.php?post_type=streams');
    add_submenu_page('college-management', 'Faculties', 'Faculties', 'manage_options', 'edit.php?post_type=faculty');
    add_submenu_page('college-management', 'Subjects', 'Subjects', 'manage_options', 'edit.php?post_type=subject');
    add_submenu_page('college-management', 'News', 'News', 'manage_options', 'edit.php?post_type=news');
//Not working
        ↓
    add_submenu_page('edit.php?post_type=news', 'News Category', 'News Category', 'manage_options', 'edit-tags.php?taxonomy=news_category');
//Not working
        ↓
    add_submenu_page('edit.php?post_type=news', 'News Tags', 'News Tags', 'manage_options', 'edit-tags.php?taxonomy=news_tags');
    add_submenu_page('college-management', 'Events', 'Events', 'manage_options', 'edit.php?post_type=event');
    add_submenu_page('college-management', 'Event Gallery', 'Event Gallery', 'manage_options', 'edit.php?post_type=event-gallery');
}

But it is not working. Whether if i will do show_in_menu = true then it is showing under the cpt News. Can someone instruct that how can i able to add it as a sub-submenu under the custom submenu.

Était-ce utile?

La solution

WP Admin doesn't support 3 level menus in the side navigation. You can do this in WP Nav Menus on the frontend, but not with the main admin menu.

If you want to do this, you'll need to rebuilt the WP Admin menu and add the necessary styling, which will be a huge job

Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange
scroll top