This thread is resolved. Here is a description of the problem and solution.
Problem:
You are using Make.com to automate translations via the WordPress REST API and GPT API for custom localization, but the translated articles are not linking to their original English posts in WPML. The translations object is empty, and manual updates using the WPML API do not establish the connection.
Solution:
Currently, WPML does not fully support creating and linking translations directly through the REST API. You can specify the language using the '?lang=' parameter when creating a post, but additional steps are required to link translations. A custom solution involves:
1. Creating the first post in one language using a standard API POST call.
2. Creating the second post in another language using another API POST call.
3. Linking both posts using a custom endpoint. Here is a code example provided by another user that might help: https://gist.github.com/djoo/5518bcf4ccef93ab83d91787c41e929a
Additionally, you can utilize WPML hooks for more functionalities:
- https://wpml.org/wpml-hook/wpml_set_element_language_details/
- https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/
Always ensure to have a backup when implementing custom code.
If this solution does not resolve your issue or seems outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at 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.