This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is creating German and English profile pages using the WordPress API and the WPML language attribute. However, these pages are not connected in WordPress, resulting in the language switcher not being available on the pages. The client wishes to programmatically mark pages as translations of each other using the API.
Solution:
We recommend connecting the pages either using the following hook or manually:
- https://wpml.org/wpml-hook/wpml_set_element_language_details/
- https://wpml.org/faq/how-to-link-already-translated-pages/
If you are using the REST API, WPML does not provide a direct method for this. However, you can create a custom REST API endpoint that utilizes the
wpml_set_element_language_details
hook to set a page as a translation of another. If this is beyond your technical capabilities, you may consider hiring a developer:
https://wpml.org/contractors/
If this solution does not seem relevant to your situation, please open a new support ticket here: WPML support forum.
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 topic contains 3 replies, has 3 voices.
Last updated by 1 year, 5 months ago.
Assisted by: Christopher Amirian.