Skip to content

Commit

Permalink
Merge pull request #1429 from goldenapples/1428-fix-comment-author-na…
Browse files Browse the repository at this point in the history
…me-display

Get comment author from the comment user_id field
  • Loading branch information
kasparsd authored Sep 13, 2023
2 parents 91fd89c + 2012eca commit 5aa2f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connectors/class-connector-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ public function get_comment_author( $comment, $field = 'id' ) {
$user_name = isset( $user->display_name ) ? $user->display_name : $comment->comment_author;
}

if ( $req_user_login ) {
$user = wp_get_current_user();
if ( $req_user_login && isset( $comment->user_id ) ) {
$user = get_user_by( 'id', $comment->user_id );
$user_id = $user->ID;
$user_name = $user->display_name;
}
Expand Down

0 comments on commit 5aa2f73

Please sign in to comment.