WordPress at a glance

remove_menu_page() WP 1.0

Remove a top-level admin menu.

  • Global. Array. $menu

No Hooks.

Return

Array/true/false. The removed menu on success, false if not found.

Usage

remove_menu_page( $menu_slug );
$menu_slug(string) (required)
The slug of the menu.

Code of remove_menu_page: wp-admin/includes/plugin.php VER 5.0.1

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

Related Functions

From tag: WP minimize (minimise reduce mitigate diminish lessen)

More from tag: Admin menu (admin panel)

No comments
    Hello, !     Log In . Register