Skip to content

Instantly share code, notes, and snippets.

@rickard2
Created April 1, 2012 14:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rickard2/2275838 to your computer and use it in GitHub Desktop.
$email = isset($comment->comment_author_email) ? $comment->comment_author_email : null;
if ( !$email && !is_integer($id_or_email) ) {
$email = $id_or_email;
}
if ( !$email && is_integer($id_or_email) ) {
$user = get_userdata($id_or_email);
$email = $user->user_email;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment