Posted By

fjarrett on 09/29/10


Tagged

wordpress


Versions (?)

Remove Admin Menus


 / Published in: PHP
 

Clean up your WordPress backend by removing unwanted admin menus that create clutter.

  1. // Remove Admin Menus
  2. function remove_menu_items() {
  3. global $menu;
  4. $restricted = array(
  5. __('Links'),
  6. __('Comments'),
  7. __('Media'),
  8. __('Plugins'),
  9. __('Tools'),
  10. __('Users')
  11. );
  12. end ($menu);
  13. while (prev($menu)) {
  14. $value = explode(' ',$menu[key($menu)][0]);
  15. if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){
  16. unset($menu[key($menu)]);
  17. }
  18. }
  19. }
  20. add_action('admin_menu', 'remove_menu_items');

Report this snippet  

You need to login to post a comment.