zirosas
6/26/2013 - 8:02 PM

WordPress Admin Dashboad modification

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');
}