0

I'm trying to make a search widget, but search results have the corresponding post attached as a link, so to get the post in the result I have to do /wp-json/wp/v2/search?_embed=self.

This works to embed the post, but then if I want to embed the post terms I seem to be out of luck.

So far I've tried:

/wp-json/wp/v2/search?_embed=self,wp:terms

/wp-json/wp/v2/search?_embed=self,self.wp:terms

/wp-json/wp/v2/search?_embed=self,self[wp:terms]

/wp-json/wp/v2/search?_embed=true

None result in any of the nested links being embedded like I was hoping. Is there a way to do this at all? If not my next thought is to just use register_rest_field to put the relevant information onto the post myself.

1

0

Your Answer

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

Browse other questions tagged or ask your own question.