Created
June 26, 2013 20:02
-
-
Save zirosas/5871094 to your computer and use it in GitHub Desktop.
WordPress Admin Dashboad modification
This file contains hidden or 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
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