Adding Other Submenus

Most plugins' option pages are placed in the Settings portion of the menu. However, if you feel that another section would be more appropriate for your plugin's page, you can simply change the add_options_page() function to one of the others shown in Listing 9-27.

Listing 9-27. Submenu functions

//Settings add_options_page (page_title, menu_title, capability, handle); // Tools add_management_page (page_title, menu_title, capability, handle); // Appearance add_theme_page (page_title, menu_title, capability, handle); // Posts add_posts_page (page_title, menu_title, capability, handle); // Pages add_pages_page (page_title, menu_title, capability, handle); // Users add_user_page (page_title, menu_title, capability, handle);

All the functions require the same arguments you saw in Listing 9-7; the only difference is the location of the resulting option page.

0 0

Post a comment