Posted By

jamiebrwr on 09/08/11


Tagged

panel links admin media users comments tools plugins


Versions (?)

Hide/Remove WordPress Admin Menus


 / Published in: PHP
 

  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.