Home›Support›English Support›[Waiting for user confirmation] Accessing translated pages using wp-json api
[Waiting for user confirmation] Accessing translated pages using wp-json api
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.
WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
Background of the issue:
I have a headless WordPress setup and I am pulling page content via the REST API. I can load the default language content fine, but when I request translated content, it just returns the default language. For example, if I access: /wp-json/wp/v2/pages?slug=about-us&lang=en_CA I get the default language's content, not my translated content. However, if I am logged into WordPress and I access the URL, I do get the translated content.
Symptoms:
Translated content is not served through the REST API unless logged in as an administrator.
Questions:
Is there a way to allow the translated content to be served without being logged in as an administrator through the API?