wpseek.com
A WordPress-centric search engine for devs and theme authors
remove_submenu_page › WordPress Function
Since3.1.0
Deprecatedn/a
› remove_submenu_page ( $menu_slug, $submenu_slug )
Parameters: (2) |
|
Returns: |
|
Defined at: |
|
Codex: |
Removes an admin submenu.
Example usage: -remove_submenu_page( 'themes.php', 'nav-menus.php' )
- remove_submenu_page( 'tools.php', 'plugin_submenu_slug' )
- remove_submenu_page( 'plugin_menu_slug', 'plugin_submenu_slug' )
Related Functions: remove_menu_page, add_submenu_page, remove_query_arg, add_menu_page, remove_image_size
Source
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; }