我希望只有帖子作者可以回复帖子评论。现在登录用户可以回复评论,但我必须将其限制为仅发布作者。我该怎么做?有什么帮助吗?
提前致谢
首先你需要自定义 wp_list_comments() html out put
https://digwp.com/2010/02/custom-comments-html-output/http://www.studiograsshopper.ch/code-snippets/customising-wp_list_comments/
在以下位置检查 get_current_user_id() 是否等于 the_author_ID() 并显示 html 输出:
<div class="reply">
<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
</div>