Posted By

vagrantradio on 09/03/10


Tagged

wordpress


Versions (?)

Remove WordPress Dashboard Widgets


 / Published in: PHP
 

Dump it in your functions file and stare at the amazing blank page when you log in!

  1. function remove_dashboard_widgets() {
  2.  
  3. global $wp_meta_boxes;
  4.  
  5. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
  6. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  7.  
  8. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  9. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  10.  
  11. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);
  12. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  13.  
  14. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  15. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  16.  
  17. }
  18.  
  19. if (!current_user_can('manage_options')) {
  20. add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
  21. }

Report this snippet  

You need to login to post a comment.