remove_submenu_page( string $menu_slug, string $submenu_slug )
Remove an admin submenu.
Description Description
Parameters Parameters
- $menu_slug
-
(string) (Required) The slug for the parent menu.
- $submenu_slug
-
(string) (Required) The slug of the submenu.
Return Return
(array|bool) The removed submenu on success, false if not found.
Source 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; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example
Removes the Widgets submenu page.
In the above example, the value of
$page
would have been: