Php 仅显示登录用户对文章的Wordpress评论
我尝试获取当前登录用户在当前帖子上的所有评论(以及管理员对此评论的回答)。其他用户应该不能看到来自其他用户的评论,除了来自管理员的顶级评论Php 仅显示登录用户对文章的Wordpress评论,php,wordpress,comments,Php,Wordpress,Comments,我尝试获取当前登录用户在当前帖子上的所有评论(以及管理员对此评论的回答)。其他用户应该不能看到来自其他用户的评论,除了来自管理员的顶级评论 $args =array ( 'status' => 'approve', 'type' => 'comment',
$args =array (
'status' => 'approve',
'type' => 'comment',
// 'post_author' => get_current_user_id(),
'post_status' => 'publish',
'post_type' => 'post',
'user_id' => get_current_user_id(),
'number' => 20,
'offset' => 0,
'order' => 'DESC',
'orderby' => 'comment_date',
'count' => true,
);
$comments = get_comments( $args );
// Referer to http://codex.wordpress.org/Function_Reference/wp_list_comments
$list_args = array(
'reverse_top_level' => false // Show the latest comments at the top of the list
);
wp_list_comments( $list_args, $comments );
这不管用,我什么也得不到。你知道如何在帖子上让用户之间的“私人”评论成为可能吗?-阅读本文
你的代码
你的代码
我不想要这个功能:仅当用户登录时才显示注释!-我想显示登录用户的评论!=>你只能看到自己的评论以及管理员对你评论的回答。