sinanisler logo

Add Custom Dashboard Metabox Widget WordPress

// Dashboard Custom Metabox Widget
add_action('admin_init', 'wpai_add_custom_meta_box');
function wpai_add_custom_meta_box() {
        'wpai_custom_meta_box', // ID of the meta box
        'Welcome',      // Title of the meta box
        'wpai_display_custom_meta_box', // Callback function
        'dashboard',            // Screen where to show the meta box (in this case, dashboard)
        'normal',                 // Context (where on the screen)
        'high'                  // Priority of the meta box
function wpai_display_custom_meta_box() {
    // This function outputs the content of the meta box
    echo '<p style="font-size:20px">Welcome, ';
	$current_user = wp_get_current_user();
	echo  $current_user->user_firstname .
	echo'<br><a href="/" style="font-size:25px; text-decoration:none; font-weight:bold">GO HOMEPAGE ▶</a> ';
	echo ' <br><br>';


Leave the first comment