This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: The user was getting default language results when using REST API in secondary langauge. Solution: Our developers are already working on this issue and a fix will be released in the upcoming releases of WPML Multilingual CMS.

In the meantime, you can use a workaround, add a parameter lang={language_code} which will return the correct language data. The URL will be then https://scoprilathailandia.com/wp-json/wp/v2/destination?_wpnonce=175f03e2c3&per_page=100&parent=0&lang=it

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by arvinA-2 1 month, 2 weeks ago.

Assigned support staff: Jamal.

Author Posts
August 30, 2019 at 10:41 am #4486491

arvinA-2

I am trying to:

Get a list of terms in a taxonomy using the REST API.

Link to a page where the issue can be seen:

The REST API URL is hidden link

Unfortunately it's an internal page.

I expected to see:

The list of destinations in italian (which is the language associated to scoprilathailandia.com).

Instead, I got:

The list in spanish (which is the default language).

Context:

This used to work correctly under WordPress 4.9.4 and WPML Multilingual CMS 4.0.8.

It stopped working after upgrading to WordPress 5.2.2 and WPML Multilingual CMS 4.2.7.1

August 30, 2019 at 11:00 am #4486731

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for contacting WPML Support. I will be glad to help with this.

Our developers are already working on this issue and a fix will be released in the upcoming releases of WPML Multilingual CMS.

In the meantime, you can use a workaround, add a parameter lang={language_code} which will return the correct language data. The URL will be then
hidden link

Best regards,
Jamal
WPML Support

August 30, 2019 at 11:39 am #4486885

arvinA-2

The workaround worked. Thanks!