From a719ecc0a296281ae4125e608f5552f3630d39a1 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 13 Feb 2010 04:04:01 +0000 Subject: [PATCH] Add add_plugins_page() function to add a submenu of the Plugins Page. Fixes #11377 git-svn-id: https://develop.svn.wordpress.org/trunk@13082 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/plugin.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index 8302d5041d..91564b126f 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -882,6 +882,25 @@ function add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $fun return add_submenu_page( 'themes.php', $page_title, $menu_title, $capability, $menu_slug, $function ); } +/** + * Add sub menu page to the plugins main menu. +* + * 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. + * + * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected + * @param string $menu_title The text to be used for the menu + * @param string $capability The capability required for this menu to be displayed to the user. + * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) + * @param callback $function The function to be called to output the content for this page. + */ +function add_plugins_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { + return add_submenu_page( 'plugins.php', $page_title, $menu_title, $capability, $menu_slug, $function ); +} + /** * Add sub menu page to the Users/Profile main menu. *