Skip to content

Instantly share code, notes, and snippets.

@spencejs
Created March 22, 2013 03:23
Show Gist options
  • Save spencejs/5218707 to your computer and use it in GitHub Desktop.
Save spencejs/5218707 to your computer and use it in GitHub Desktop.
Add Alert to Wordpress Admin
//New User Alert
add_action( 'admin_notices', 'custom_error_notice' );
function custom_error_notice(){
global $current_user;
get_currentuserinfo();
$author_info = get_userdata($current_user->ID);
if($author_info->title == '')
echo '<div class="error"><p><strong>New User:</strong> Please visit your <a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php" title="Your Profile">Profile</a> to Fill in your Job Title and set your Display Name. This alert will go away when you Job Title is set.</p></div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment