Skip to content

Instantly share code, notes, and snippets.

@zirosas
Created June 26, 2013 20:02
Show Gist options
  • Save zirosas/5871094 to your computer and use it in GitHub Desktop.
Save zirosas/5871094 to your computer and use it in GitHub Desktop.
WordPress Admin Dashboad modification
function 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']);
// Remove right now
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']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
}
function dashboard_widget_function() {
global $current_user;
// Display whatever it is you want to show
echo "Hello ". $current_user->user_login .", all new WordPress Dashboad.";
}
//Action hook
function add_dashboard_widgets() {
wp_add_dashboard_widget('dashboard_widget', 'Welcome message', 'dashboard_widget_function');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment