|
@@ -26,18 +26,22 @@ Digging into WP - http://digwp.com/2010/10/customize-wordpress-dashboard/
|
|
|
|
|
|
|
|
// disable default dashboard widgets
|
|
// disable default dashboard widgets
|
|
|
function disable_default_dashboard_widgets() {
|
|
function disable_default_dashboard_widgets() {
|
|
|
- // remove_meta_box( 'dashboard_right_now', 'dashboard', 'core' ); // Right Now Widget
|
|
|
|
|
- remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'core' ); // Comments Widget
|
|
|
|
|
- remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'core' ); // Incoming Links Widget
|
|
|
|
|
- remove_meta_box( 'dashboard_plugins', 'dashboard', 'core' ); // Plugins Widget
|
|
|
|
|
-
|
|
|
|
|
- // remove_meta_box('dashboard_quick_press', 'dashboard', 'core' ); // Quick Press Widget
|
|
|
|
|
- remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'core' ); // Recent Drafts Widget
|
|
|
|
|
- remove_meta_box( 'dashboard_primary', 'dashboard', 'core' ); //
|
|
|
|
|
- remove_meta_box( 'dashboard_secondary', 'dashboard', 'core' ); //
|
|
|
|
|
-
|
|
|
|
|
- // removing plugin dashboard boxes
|
|
|
|
|
- remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal' ); // Yoast's SEO Plugin Widget
|
|
|
|
|
|
|
+ global $wp_meta_boxes;
|
|
|
|
|
+ // unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); // Right Now Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']); // Activity Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); // Comments Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); // Incoming Links Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); // Plugins Widget
|
|
|
|
|
+
|
|
|
|
|
+ // unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // Quick Press Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); // Recent Drafts Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); //
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); //
|
|
|
|
|
+
|
|
|
|
|
+ // remove plugin dashboard boxes
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['yoast_db_widget']); // Yoast's SEO Plugin Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['rg_forms_dashboard']); // Gravity Forms Plugin Widget
|
|
|
|
|
+ unset($wp_meta_boxes['dashboard']['normal']['core']['bbp-dashboard-right-now']); // bbPress Plugin Widget
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
have more plugin widgets you'd like to remove?
|
|
have more plugin widgets you'd like to remove?
|
|
@@ -96,7 +100,7 @@ function bones_custom_dashboard_widgets() {
|
|
|
|
|
|
|
|
|
|
|
|
|
// removing the dashboard widgets
|
|
// removing the dashboard widgets
|
|
|
-add_action( 'admin_menu', 'disable_default_dashboard_widgets' );
|
|
|
|
|
|
|
+add_action( 'wp_dashboard_setup', 'disable_default_dashboard_widgets' );
|
|
|
// adding any custom widgets
|
|
// adding any custom widgets
|
|
|
add_action( 'wp_dashboard_setup', 'bones_custom_dashboard_widgets' );
|
|
add_action( 'wp_dashboard_setup', 'bones_custom_dashboard_widgets' );
|
|
|
|
|
|