Handle blank display_name for commenters. props mrmist. fixes #7494

git-svn-id: https://develop.svn.wordpress.org/trunk@9781 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2008-11-19 06:58:44 +00:00
parent 8f213372ea
commit 03792b2e62
2 changed files with 11 additions and 3 deletions
+9 -3
View File
@@ -21,10 +21,16 @@
*/
function get_comment_author() {
global $comment;
if ( empty($comment->comment_author) )
$author = __('Anonymous');
else
if ( empty($comment->comment_author) ) {
if (!empty($comment->user_id)){
$user=get_userdata($comment->user_id);
$author=$user->user_login;
} else {
$author = __('Anonymous');
}
} else {
$author = $comment->comment_author;
}
return apply_filters('get_comment_author', $author);
}