目前,我正在使用Postman访问端点,我已经成功地进行了基本身份验证,但到目前为止,我无法获得所有注册用户。我的请求:
https://example.com/wp-json/wp/v2/users
仅返回有帖子的用户,即使我插入了:add_filter( \'rest_user_query\' , \'custom_rest_user_query\' );
function custom_rest_user_query( $prepared_args, $request = null ) {
unset($prepared_args[\'has_published_posts\']);
return $prepared_args;
}
在我的函数文件中。我还尝试应用过滤器:https://example.com/wp-json/wp/v2/users?filter[per_page]=0
但我还是得到了同样的结果:只有有帖子的用户。几天来我一直在头痛。。。