WordPress判断评论用户是否为注册用户

if ($comment->user_id !== '0') {//这里通过用户ID来判断
    echo '<span class="c-author"><a target="_blank" href="' . get_author_posts_url($comment->user_id) . '">' . get_comment_author() . '</a></span>';
} else {
    echo '<span class="c-author">' . get_comment_author_link() . '</span>';
}

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据