In my react project i am using worpdress as backend and need to use my custom post type events
comments also.
So as per the WordPress documentation for comments API i am using an endpoint like this
“/wp/wp-json/wp/v2/comments?events=704
”; so according to this it should display only 704 post-ids comments.
But in my case it returns me all the comments which are posted in the post_type = post
also. See below JSON result of the above API endpoint for custom post type.
Here is a 'post_type' => post
comment's data that returns a correct result.
I have passed this argument in the register_post_type 'show_in_rest'=> true