Summery Summery
Remove an admin submenu.
Syntax Syntax
Parameters Parameters
- $menu_slug
-
(Required) The slug for the parent menu.
- $submenu_slug
-
(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; }
Advertisement
Changelog Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |