0

I'm trying to make a page in my plugin, but don't want it to appear in admin_menu, but just in my plugin page menu! I have a lot of pages, don't want them all to appear as sub menus! any ideas?

0

Use add_submenu_page and set $parent_slug to null:

add_action('admin_menu', 'wpdocs_register_my_custom_submenu_page');

function wpdocs_register_my_custom_submenu_page() {
    add_submenu_page( 
        null,
        'My Custom Submenu Page',
        'My Custom Submenu Page',
        'manage_options',
        'my-custom-submenu-page',
        'my_custom_submenu_page_callback',
    );
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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