shahin8r / comments-posts-wp-api

WP plugin that plugs comments data into the /posts endpoint in WordPress JSON API (WP-API)
MIT License
3 stars 1 forks source link

values are not showing up from array #2

Closed umairrazzaq closed 7 years ago

umairrazzaq commented 7 years ago

Hi. Thanks for this plugin first all, but I'm still facing a problem here. I can't manage to show values from array. e.g. I want to show author name from comment. I've tried different possible methods to retrieve it but no luck.

  1. response.post_comments.comments.author.avatar - not working
  2. response.post_comments.comments[].author.avatar - not working
  3. response.post_comments.comments[0].author.avatar - not working
  4. response.post_comments.comments[.author.avatar] - not working
  5. response.post_comments.comments[response.author.avatar] - not working

Please assist me that how can i show values from array object. Thanks

shahin8r commented 7 years ago

This plugin is not maintained anymore. I believe the WP REST API v2 is integrated in WP now days and this plugin was originally for the v1.

However if you could do a console.log(response) and paste the output we could check to see if it gets the correct data and get you going with your code.