diff --git wp-includes/comment-template.php wp-includes/comment-template.php
index e9245f5..b83bddd 100644
|
|
|
20 | 20 | * @param int $comment_ID The ID of the comment for which to retrieve the author. Optional. |
21 | 21 | * @return string The comment author |
22 | 22 | */ |
23 | | function get_comment_author( $comment_ID = 0 ) { |
| 23 | function get_comment_author( $comment_ID = 0, $before_alias = null, $after_alias = null ) { |
24 | 24 | $comment = get_comment( $comment_ID ); |
25 | | if ( empty($comment->comment_author) ) { |
26 | | if (!empty($comment->user_id)){ |
27 | | $user=get_userdata($comment->user_id); |
28 | | $author=$user->user_login; |
29 | | } else { |
30 | | $author = __('Anonymous'); |
31 | | } |
32 | | } else { |
33 | | $author = $comment->comment_author; |
34 | | } |
| 25 | |
| 26 | $author = __( 'Anonymous' ); |
| 27 | |
| 28 | if ( ! empty( $comment->comment_author ) ) { |
| 29 | $author = $comment->comment_author; |
| 30 | |
| 31 | if ( ! empty( $comment->user_id ) ) { |
| 32 | $user = get_userdata( $comment->user_id ); |
| 33 | |
| 34 | if ( $author != $user->display_name ) { |
| 35 | if ( is_null( $before_alias ) ) { |
| 36 | $before_alias = __(' (Initially posted by ' ); |
| 37 | } |
| 38 | |
| 39 | if ( is_null( $after_alias ) ) { |
| 40 | $after_alias = __(')'); |
| 41 | } |
| 42 | |
| 43 | $author = $user->display_name . $before_alias . $author . $after_alias; |
| 44 | } // $author != $user->display_name |
| 45 | } // ! empty( $comment->user_id ) |
| 46 | } // ! empty( $comment->comment_author ) |
| 47 | |
35 | 48 | return apply_filters('get_comment_author', $author); |
36 | 49 | } |
37 | 50 | |