[wp-trac] Re: [WordPress Trac] #7494: registered members displayed as "anonymous" in comments if display_name empty (has fix)

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 11 10:30:27 GMT 2008


#7494: registered members displayed as "anonymous" in comments if display_name
empty (has fix)
---------------------+------------------------------------------------------
 Reporter:  _ck_     |        Owner:  anonymous
     Type:  defect   |       Status:  new      
 Priority:  normal   |    Milestone:  2.7      
Component:  General  |      Version:  2.6      
 Severity:  normal   |   Resolution:           
 Keywords:           |  
---------------------+------------------------------------------------------
Comment (by _ck_):

 There is a serious typo in my above replacement function, sorry:

 {{{
 function get_comment_author() {
         global $comment;

         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);
 }

 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7494#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list