Good Morning,
We can not see the post relationships in the rest api (json) of WordPress. Before updating everything was simpler (_belongs to) but everything has disappeared and we need to obtain from the rest api the relations between post. Please, how does this relationship work now in the rest api? How can we know, through a query, the relationship between a post-type and a post-type?
Thank en advanced from Spain
To access related posts in PHP, we now provide the Post Relationships API: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
One way you could access related post information in REST is to set up a View filtered by post relationship, and use the API to retrieve the results of that View. The toolset-rest plugin created by Adriano shows how to get the results of a View: (hidden link). Otherwise, you'll have to set up a custom endpoint in the REST API, and use the Post Relationships API to return the correct information. Customizing the REST API is outside the scope of support we provide here, unfortunately.
If you'd like to see more REST API integration, please let our developers know by submitting a new ticket using the "Suggest an improvement" feature.