It's not duplicating the translated terms, but rather it is assigning the default language term to the translated post even though i give the translated term ID wit wp_set_post_terms.
Example:
Base Language: German
German Post ID: 1
English Post ID: 2
taxonomy name: test
German Term ID: 1001
English Term ID: 1002
the terms and posts are correctly translated.
i now call the following code:
// set german post terms
wp_set_post_terms( 1, array(1001), 'test', false );
// set english post terms
wp_set_post_terms( 2, array(1002), 'test', false );
if i check in the backend afterwards, the german post will have the term assigned, the english post will show no terms.
In the DB we can see that:
- german post has 1001 assigned => correct
- english post has 1001 assigned => false, should be 1002 like i've given in the set_post_terms call
I got some information from our 2nd tier support. This issue is related to the Auto Adjust ID feature of WPML, where WPML adjusts the IDs to current languages. There are two workarounds to fix this issue:
1. Go to WPML> Languages > Make themes work multilingual > Disable option "Adjust IDs for multilingual functionality".
2. (Recommend) Remove the WPML filters temporarily and add them back after adding the terms:
❌ IMPORTANT: Please backup your database and website before proceeding ❌
If you want to check this on a sandbox site, please click on this link, you will be redirected to the admin area directly hidden link
Looking forward to your reply.
Thanks
The topic ‘[Closed] I am on WPML Version 4.6.10 and this error is occurring again’ is closed to new replies.