wordpress hide admin panels


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



Copy this code and paste it in your HTML
  1. // disable default dashboard widgets
  2. function remove_dashboard_widgets() {
  3.  
  4. global $wp_meta_boxes;
  5.  
  6. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  7. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  8. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  9. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  10.  
  11. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
  12. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
  13. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  14. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  15. }
  16. add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
  17.  
  18.  
  19. // disable default dashboard widgets
  20. function disable_default_dashboard_widgets() {
  21.  
  22. remove_meta_box('dashboard_right_now', 'dashboard', 'core');
  23. remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
  24. remove_meta_box('dashboard_incoming_links', 'dashboard', 'core');
  25. remove_meta_box('dashboard_plugins', 'dashboard', 'core');
  26.  
  27. remove_meta_box('dashboard_quick_press', 'dashboard', 'core');
  28. remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core');
  29. remove_meta_box('dashboard_primary', 'dashboard', 'core');
  30. remove_meta_box('dashboard_secondary', 'dashboard', 'core');
  31. }
  32. add_action('admin_menu', 'disable_default_dashboard_widgets');
  33.  
  34. // admin see everything
  35. if (!current_user_can('manage_options')) {
  36. add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets');
  37. }

URL: http://digwp.com/2010/10/customize-wordpress-dashboard/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+DiggingIntoWordpress+%28Digging+Into+WordPress%29&utm_content=Google+Reader

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.