Skip Navigation

[Resuelto] How to show post relationships in WordPress rest api

This support ticket is created hace 6 años, 2 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por pumpun hace 6 años, 2 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1105397

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

#1105621

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: (enlace oculto). 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.

#1105623

Thanks