Wrong author name showing up for comments
-
We’ve had this issue for a while, but I’m only now debugging it. We’re running the latest molongui, wordpress, Newspaper theme, etc (plugins are set to auto-update). When a logged-in (non-guest) user leaves a comment, the display name shows up as the post author. You can see an example of it with this comment:
https://www.theurbanist.org/2021/01/12/sand-point-way-streetcar/#comment-20828
The post author is Joe Mangan (who is a guest author), and the person leaving the comment is Doug Trumm (who is an administrator user). The profile picture on the comment is correct, and the comment author url is correct (it points to https://www.theurbanist.org/members/dmtrumm/), but the comment author name shows up as Joe Mangan rather than Doug Trumm.
I looked in the code; the Newspaper theme (and specifically, its td-standard-pack plugin) has a function called td_comment() that has the following:
<cite><?php comment_author_link() ?></cite>
Comment_author_link() is a core wordpress function, which calls get_comment_author_link(). The $comment variable is set with get_comment($comment_ID), where $comment_ID is 0. The returned object in $comment contains the has the wrong ‘comment_author’ value but the correct ‘comment_author_url’ value.
Let me know if there’s anything I should check.
The page I need help with: [log in to see the link]
The topic ‘Wrong author name showing up for comments’ is closed to new replies.