How can i remove the whole menu in the admin?
I have this code:
function remove_menu_items() {
global $menu;
end( $menu );
while ( prev($menu) ) {
$value = explode( ' ', $menu[ key($menu) ][0] );
if ( $value[0] != NULL ? $value[0] : "" ) {
unset( $menu[ key($menu) ] );
}
}
}
add_action( 'admin_menu', 'remove_menu_items' );
This only removes the default menu items, any pages added to the menu by a plugin are still there.
How can i remove the whole menu?
Now I want to know: why? 🙂
Use the following to remove the entire thing:
Hope this helps!
Btw, the admin menu code is in /wp-admin/menu.php if you want to look at it and mess with certain items.
You could use CSS:
Or you could use Javascript and hide each element.
Target #menu-media, #menu-links and so on.
Or you could do this:
Just remember that other plugins may add menus after this point.