Ticket #10653: get_comment_author.patch
File get_comment_author.patch, 1.0 KB (added by , 15 years ago) |
---|
-
wp-includes/comment-template.php
19 19 * 20 20 * @return string The comment author 21 21 */ 22 function get_comment_author( ) {22 function get_comment_author($before_alias = ' (Initially posted by ', $after_alias = ')') { 23 23 global $comment; 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 24 $author = __('Anonymous'); 25 if (!empty($comment->user_id)) { 26 $user = get_userdata($comment->user_id); 27 $author = $user->display_name; 28 if (!empty($comment->comment_author) && $author != $comment->comment_author) { 29 $author = $author.$before_alias.$comment->comment_author.$after_alias; 30 30 } 31 } else {31 } elseif (!empty( $comment->comment_author)) { 32 32 $author = $comment->comment_author; 33 33 } 34 34 return apply_filters('get_comment_author', $author);