Wordpress - Remove stuff from Dashboard


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. add_action( 'admin_menu', 'custom_admin_menu' );
  2.  
  3. function custom_admin_menu()
  4. {
  5. global $menu;
  6. /*
  7. echo '<pre>';
  8. var_dump($menu); // use this to identify the key for the menu item you want to remove
  9. echo '</pre>';
  10. */
  11. unset( $menu[5] ); //key 5 is posts
  12. unset( $menu[15] ); //key 15 is links
  13. unset( $menu[25] ); //key 25 is comments
  14. if ( !current_user_can('manage_options') ) { unset( $menu[75] ); } //key 75 is tools ... but only for non super admins
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.