Skip to content

Commit

Permalink
Fix read property "comment_parent" on null
Browse files Browse the repository at this point in the history
  • Loading branch information
x-Felix authored Sep 3, 2024
1 parent 7df1fa4 commit 13051ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class="mdx-reply-time"><?php echo human_time_diff(get_comment_time('U'), current

//回复的评论加@
function comment_add_at($comment_text, $comment) {
if ($comment->comment_parent > 0) {
if (isset($comment->comment_parent) && $comment->comment_parent > 0) {
$comment_text = '<a rel="nofollow" class="comment_at" href="#comment-'.$comment->comment_parent.'">@'.get_comment_author($comment->comment_parent).':</a> '.$comment_text;
}
return $comment_text;
Expand Down

0 comments on commit 13051ad

Please sign in to comment.