remove_submenu_page( string $menu_slug, string $submenu_slug )
Remove an admin submenu.
Parameters
- $menu_slug
-
(Required) The slug for the parent menu.
- $submenu_slug
-
(Required) The slug of the submenu.
Return
(array|bool) The removed submenu on success, false if not found.
Source
File: wp-admin/includes/plugin.php
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;
}
Changelog
Version | Description |
---|---|
WP-3.1.0 | Introduced. |