A WordPress-centric search engine for devs and theme authors



remove_menu_page ›

Since3.1.0
Deprecatedn/a
remove_menu_page ( $menu_slug )
Parameters:
  • (string) $menu_slug The slug of the menu.
    Required: Yes
Returns:
  • (array|bool) The removed menu on success, false if not found.
Defined at:
Codex:

Remove a top-level admin menu.



Source

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;
}