Posted By

javifr on 10/29/10


Tagged

wordpress admin customization


Versions (?)

Admin remove menu options


 / Published in: PHP
 

  1.  
  2. add_action('admin_menu', 'remove_menus');
  3.  
  4. function remove_menus () {
  5. global $menu;
  6. $restricted = array( __('Posts'), __('Comments'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'),__('Contact'),__('Xarxa'));
  7. end ($menu);
  8. while (prev($menu)){
  9. $value = explode(' ',$menu[key($menu)][0]);
  10. if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
  11. }
  12. }
  13.  

Report this snippet  

You need to login to post a comment.