Monday, May 21, 2012

Remove wordpress admin dashboard widgets






function pathshala_remove_dashboard_widgets() {

    // Globalize the metaboxes array, this holds all the widgets for wp-admin
     global $wp_meta_boxes;

    // Remove the incomming links widget
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);   
//$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']
    // Remove right now
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
    //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'pathshala_remove_dashboard_widgets' );

?>

No comments:

Post a Comment