WordPress开发者和主题制作者的搜索引擎



remove_menu_page ›

Since3.1.0
已弃用n/a
remove_menu_page ( $menu_slug )
参数:
  • (string) $menu_slug The slug of the menu.
    Required: Yes
返回:
  • (array|bool) The removed menu on success, false if not found.
定义在:
文档:

Remove a top-level admin menu.



源码

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