函数原型
remove_menu_page( string $menu_slug ): array|false
函数描述
Removes a top-level admin menu.
是否弃用
未弃用
函数参数
-
$menu_slug
string
Required - The slug of the menu.
函数返回值
array|false The removed menu on success, false if not found.
函数位置
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |

