Index: wp-admin/includes/plugin.php
===================================================================
--- wp-admin/includes/plugin.php	(revision 15518)
+++ wp-admin/includes/plugin.php	(working copy)
@@ -852,12 +852,6 @@
 /**
  * Add a top level menu page in the 'objects' section
  *
- * 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.
@@ -876,12 +870,6 @@
 /**
  * Add a top level menu page in the 'utility' section
  *
- * 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.
@@ -900,12 +888,6 @@
 /**
  * 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.
- *
  * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page)
  * @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
@@ -962,13 +944,7 @@
 
 /**
  * Add sub menu page to the tools 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.
@@ -981,13 +957,7 @@
 
 /**
  * Add sub menu page to the options 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.
@@ -1000,13 +970,7 @@
 
 /**
  * Add sub menu page to the themes 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.
@@ -1019,13 +983,7 @@
 
 /**
  * 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.
@@ -1038,13 +996,7 @@
 
 /**
  * Add sub menu page to the Users/Profile 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.
@@ -1060,13 +1012,7 @@
 }
 /**
  * Add sub menu page to the Dashboard 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.
@@ -1079,13 +1025,7 @@
 
 /**
  * Add sub menu page to the posts 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.
@@ -1098,13 +1038,7 @@
 
 /**
  * Add sub menu page to the media 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.
@@ -1117,13 +1051,7 @@
 
 /**
  * Add sub menu page to the links 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.
@@ -1136,13 +1064,7 @@
 
 /**
  * Add sub menu page to the pages 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.
@@ -1155,13 +1077,7 @@
 
 /**
  * Add sub menu page to the comments 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.
@@ -1172,7 +1088,54 @@
 	return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function );
 }
 
+
 /**
+ * Remove a top level menu page
+ *
+ * @since 3.1.0
+ *
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)
+ * @return array|bool The removed menu item on success, False if not found
+ */
+function remove_menu_page( $menu_slug ) {
+	global $menu;
+
+	foreach ( $menu as $i => $item ) {
+		if ( $menu_slug == $item[2] ) {
+			unset($menu[$i]);
+			return $item;
+		}
+	}
+
+	return false;
+}
+
+/**
+ * Remove a top level menu page
+ *
+ * @since 3.1.0
+ *
+ * @param string $menu_slug The slug name of the parent menu
+ * @param string $menu_slug The slug name of the submenu
+ * @return array|bool The removed submenu item on success, False if not found
+ */
+function remove_submenu_page( $menu_slug, $submenu_slug ) {
+	global $submenu;
+
+	if ( !isset($submenu[$menu_slug]) )
+		return false;
+
+	foreach ( $submenu[$menu_slug] as $i => $item ) {
+		if ( $submenu_slug == $item[2] ) {
+			unset($submenu[$menu_slug][$i]);
+			return $item;
+		}
+	}
+
+	return false;
+}
+
+/**
  * Get the url to access a particular menu page based on the slug it was registered with.
  *
  * If the slug hasn't been registered properly no url will be returned
