Display a Notice that can be Dismissed after Theme Activation

Useful code snippet, which shows a notice in the dashboard when the theme is activated which can be dismissed. Add this code to the functions.php.

add_action('admin_notices', 'admin_notice');

function admin_notice() {
	global $current_user;
        $user_id = $current_user->ID;
        /* Check that the user hasn't already clicked to ignore the message */
	if ( ! get_user_meta($user_id, 'ignore_notice') ) {
        echo '<div class="updated"><p>'; 
        printf(__('Thanks for choosing our theme! Please use the <strong><a href="' . get_admin_url() . 'customize.php' . '">theme customizer</a></strong> to customize your theme.'), '?nag_ignore=0');
        echo "</p></div>";
	}
}

add_action('admin_init', 'nag_ignore');

function nag_ignore() {
	global $current_user;
        $user_id = $current_user->ID;
        /* If user clicks to ignore the notice, add that to their user meta */
        if ( isset($_GET['nag_ignore']) && '0' == $_GET['nag_ignore'] ) {
             add_user_meta($user_id, 'ignore_notice', 'true', true);
	}
}