Last active
July 9, 2016 20:35
-
-
Save ambercouch/05abdc9c8bd4e0e811733fb854f202d8 to your computer and use it in GitHub Desktop.
WordPress Bones theme remove admin widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// disable default dashboard widgets | |
function disable_default_dashboard_widgets() { | |
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']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
// 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']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); // | |
// 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 | |
} | |
add_action( 'wp_dashboard_setup', 'disable_default_dashboard_widgets' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment