duanhan3067 2015-01-05 00:03
浏览 49
已采纳

使用WP-API发布数据返回注释

I'm using the WP-API plugin as a RESTful API to my Wordpress site. I want the comments associated with a post to return from the /posts/:id endpoint. The docs indicate that this is possible by passing a withcomments filter, however I can't get this to work. I've tried the following with no success:

http://climbingnarc.com/wp-json/posts/24001?filter[withcomments]=1

http://climbingnarc.com/wp-json/posts/24001?filter[withcomments]=true

I do know that http://climbingnarc.com/wp-json/posts/24001/comments works, but I don't want to have to make a separate request just for the comment data.

Is there a correct way to use this filter so that comments are returned with the post data?

  • 写回答

4条回答 默认 最新

  • doubiantiao4994 2015-02-03 16:42
    关注

    I opened an issue on Github about this and it was marked as Enhancement, so I'm assuming this just doesn't work at this point

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看