Dhaulagiri Dhaulagiri - 2 months ago 12
JSON Question

Return comments with WP-API Post data

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?

Answer

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

Comments