WordPress Snippets at WPcustoms

Disable Submenus from the Admin Panel

Hide menu items in your admin area. The menu-IDs are found in wp-admin/menu.php


/**
 * Snippet Name: Disable Submenus from the Admin Panel
 * Snippet URL: http://www.wpcustoms.net/snippets/disable-submenus-admin-panel/
 */
 function wpc_remove_submenus() {
  global $submenu;
    unset($submenu['index.php'][10]); // Removes 'Updates'.
    unset($submenu['themes.php'][5]); // Removes 'Themes'.  
    unset($submenu['options-general.php'][15]); // Removes 'Writing'.
    unset($submenu['options-general.php'][25]); // Removes 'Discussion'.       
}
add_action('admin_menu', 'wpc_remove_submenus');