Return to Snippet

Revision: 52372
at October 21, 2011 02:28 by florent


Initial Code
<?php
    function remove_dashboard_widgets() {
        global $menu,$submenu;
 
        global $current_user;
        get_currentuserinfo();
 
        if ($current_user->ID != 1) { // only admin sees the whole thing
            // $menu and $submenu will return fo all menu and submenu list in admin panel .
            $menu[2] = ""; //Dashboard
            $menu[5] = ""; // Posts
            $menu[15] = ""; //Links
            $menu[25] = ""; //Comments
            $menu[65] = ""; //Plugins
 
            unset($submenu['themes.php'][5]); //themes
            unset($submenu['themes.php'][12]); //editor
        }
    }
    add_action('admin_head', 'remove_dashboard_widgets');
?>

Initial URL


Initial Description


Initial Title
Hide items from wp-admin menu 

Initial Tags
wordpress

Initial Language
PHP