Remove dashboard widgets according to user role

function customize_meta_boxes() { //retrieve current user info global $current_user; get_currentuserinfo(); //if current user level is less than 3, remove the postcustom meta box if ($current_user->user_level < 3) remove_meta_box('postcustom','post','normal'); } add_action('admin_init','customize_meta_boxes');
If you’re owning a multi-user blog, it may be useful to know how to hide some dashboard widgets to keep confidential information in a safe place.
The following code will remove the postcustom meta box for “author” (role 2). To apply the hack on your own blog, just copy the code below and paste it in your functions.php file.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.