用户只能在wordpress中看到他们的评论

时间:2016-11-20 07:06:46

标签: wordpress

用户是否有任何方式只能在wordpress中看到他们的评论?

我重申这个话题: Commenter should see only his comments in wordpress

但没用。

问候

评论模板的代码:

<ol class="comment-list"> 
    <?php wp_list_comments( array( 'style' => 'ol', 'short_ping' => true, ) ); ?> 
</ol><!-- .comment-list -->

1 个答案:

答案 0 :(得分:0)

您正在尝试修改默认的wordpress设置 - 在这种情况下,php不仅仅是必要的。您所附链接的解决方案是最简单和最优雅的 - 如果重要的是聘请开发人员为您执行此操作。

这是一些示例代码:

<ol class="comment-list">
    <?php $user_id = get_current_user_id();
        $user_comments = get_comments( 'user_id' => $user_id );
        wp_list_comments( 
            array( 'style' => 'ol', 'short_ping' => true, ), 
        $user_comments ); ?> 
</ol>
相关问题