remove_menu_page

Advertisement

Summery Summery

Remove a top-level admin menu.

Syntax Syntax

remove_menu_page( string $menu_slug )

Parameters Parameters

$menu_slug

(Required) The slug of the menu.

Return Return

(array|bool) The removed menu on success, false if not found.

Source Source

File: wp-admin/includes/plugin.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;
}

Advertisement

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Advertisement

Leave a Reply