0
votes

My goal

I want to be able to send a request like this https://myblog.com/wp-json/wp/v2/categories?language=4 to get only the categories that are assigned to my language with the ID 4.

What I have tried I have already added the code mentioned by @mastababa here. So now I am able to call https://myblog.com/wp-json/wp/v2/language to get all languages defined by me via the plugin Polylang and after that I can call https://myblog.com/wp-json/wp/v2/posts?language=4 to get all posts only for the language with the ID 4.

I am using Wordpress 5.5.1 and Polylang 2.8.3

Thanks for your help!

1
@AngelDeykov I have already mentioned this link aboveMichael

1 Answers

0
votes

I think by default you need Polylang Pro to be able to do that. See docs: https://polylang.pro/doc/rest-api/ Then you can call API like this: https://myblog.com/wp-json/wp/v2/categories?lang=en