Skip to main content

Adds a submenu page in the Admin section of your WordPress website.

This function takes a capability which will be used to determine whether or not a page is included in the menu.

The function which is hooked in to handle the output of the page must check that the user has the required capability as well.

This function should normally be hooked in with one of the the admin_menu actions depending on the menu where the sub menu is to appear.

Example

add_submenu_page( 
    'tools.php', // parent slug
    'My Custom Submenu Page', // page title
    'My Custom Submenu Page', //menu title
    'manage_options', // capability
    'my-custom-submenu-page', // menu slug
    'my_custom_submenu_page_callback' // callback to print the output
); 

Reference