Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Remove unnecessary dashboard items from Non-Admin */
- function remove_menus()
- {
- global $menu;
- global $current_user;
- get_currentuserinfo();
- if($current_user->user_level < 10) {
- $restricted = array(__('Pages'),
- __('Links'),
- __('Custom Post Name'), // This is custom post
- __('Appearance'),
- __('Plugins'),
- __('Tools'),
- __('Settings'),
- );
- end ($menu);
- while (prev($menu)) {
- $value = explode(' ',$menu[key($menu)][0]);
- if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
- }
- }
- }
- add_action('admin_menu', 'remove_menus');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement