WordPress Code Snippets

A fresh mix of code snippets and tutorials

Remove sub-menus

19

Quick snippet for removing or disabling WordPress sub-menus:

function remove_submenus() {
	global $menu;
	global $current_user;
	get_currentuserinfo();
	if($current_user->user_login == 'username') {
		global $submenu;
		unset($submenu['themes.php'][10]);
	}
}
add_action('admin_menu', 'remove_menus');

Learn more

WordPress Themes In Depth


Show Support

Like our new Facebook Page to show support!