Marian Enache
Marian Enache

Reputation: 61

How to get wordpress api data by language?

Let's say I have this api http://someUrlHere.com/wp-json/wp/v2/posts?categories=19&per_page=20 and I call it with GET method. How can I choose what language I want to receive the information? It should pe provided in 2 languages. Or how do I find out if it is provided only in English?

Upvotes: 4

Views: 8162

Answers (1)

Sergio Gandrus
Sergio Gandrus

Reputation: 159

Activate WPML Translation Management and then you must add

lang=en

as parameter to your call:

http://someUrlHere.com/wp-json/wp/v2/posts?categories=19&per_page=20&lang=en

Upvotes: 8

Related Questions