Fall back to comment author email in get_avatar() if the user who left the comment no longer exists.

props mauryaratan, lite3.
fixes #25803.
Built from https://develop.svn.wordpress.org/trunk@26000


git-svn-id: http://core.svn.wordpress.org/trunk@25933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-11-02 12:20:11 +00:00
parent e0e2ace724
commit 40391f4e37
1 changed files with 5 additions and 4 deletions

View File

@ -1650,9 +1650,10 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
$user = get_userdata($id);
if ( $user )
$email = $user->user_email;
} elseif ( !empty($id_or_email->comment_author_email) ) {
$email = $id_or_email->comment_author_email;
}
if ( ! $email && ! empty( $id_or_email->comment_author_email ) )
$email = $id_or_email->comment_author_email;
} else {
$email = $id_or_email;
}