Skip to main content
added 96 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 254
  • 458

Add a sub menu page.

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:

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

Add a sub menu page.

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', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); 

Reference

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

Add a sub menu page.

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', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); 

Reference

Add a sub menu page.

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', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); 

Reference

Link