0

I am using angular to get a list of posts back from the post endpoint for the wp api.

These posts have different taxonomies and terms associated with them.

I want to use angular's search filters to quickly get through the list but I want to do it on each taxonomy's terms associated to the post.

The problem is, the post endpoint does not show associated taxonomy or terms for each post.

What's the best approach here?

3

Ok, I just stumbled upon the answer buried deep in the github issues page:

https://github.com/WP-API/WP-API/issues/1403

The answer is:

the reason is that the terms / meta etc are different objects, and in typical REST design going a GET on a single resource, will give you that resource, not that resource and a bunch of other ones too. However, you can pass _embed to the request which will include the linked resources in the response, for example see http://demo.wp-api.org/wp-json/wp/v2/posts/111?_embed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.