Disable submenus from Admin Panel

This snippet disables submenus, like Themes and Writing, from the Admin Pane. The menu-ID:s are found in wp-admin/menu.php.

<br />
function remove_submenus() {<br />
  global $submenu;<br />
    unset($submenu['index.php'][10]); // Removes 'Updates'.<br />
    unset($submenu['themes.php'][5]); // Removes 'Themes'.<br />
    unset($submenu['options-general.php'][15]); // Removes 'Writing'.<br />
    unset($submenu['options-general.php'][25]); // Removes 'Discussion'.<br />
}<br />
add_action('admin_menu', 'remove_submenus');<br />

Code Snippet:

Posted in Admin area