Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 仅显示登录用户对文章的Wordpress评论_Php_Wordpress_Comments - Fatal编程技术网

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 );
这不管用,我什么也得不到。你知道如何在帖子上让用户之间的“私人”评论成为可能吗?

-阅读本文

你的代码
你的代码

我不想要这个功能:仅当用户登录时才显示注释!-我想显示登录用户的评论!=>你只能看到自己的评论以及管理员对你评论的回答。