Make WordPress Core


Ignore:
Timestamp:
11/19/2008 06:58:44 AM (18 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r9773 r9781  
    2222function get_comment_author() {
    2323        global $comment;
    24         if ( empty($comment->comment_author) )
    25                 $author = __('Anonymous');
    26         else
     24        if ( empty($comment->comment_author) ) {
     25                if (!empty($comment->user_id)){
     26                        $user=get_userdata($comment->user_id);
     27                        $author=$user->user_login;
     28                } else {
     29                        $author = __('Anonymous');
     30                }
     31        } else {
    2732                $author = $comment->comment_author;
     33        }
    2834        return apply_filters('get_comment_author', $author);
    2935}
Note: See TracChangeset for help on using the changeset viewer.