Skip Navigation

[Resolved] How to use the old relationships method with WPML

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

Problem:

Translate posts + custom fields with WPML plugins.

Solution:

You can follow WPML document to translate posts and custom fields.

Relevant Documentation:

https://wpml.org/tutorials/2016/08/how-to-create-and-translate-custom-post-types/

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Amin 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1658997

I have a site using the old relationships many-to-many model (joint table). We are also using WPML to present the site in English and Spanish.

When I create a new child post on this many-to-many relationship, it stores the ID of the post in the language that we're viewing the site. However, we want the relationship to also be translated.

We have a Toolset View that presents that data based on the values in this joint table of the many-to-many relationship.

Eg. If someone creates the child post of the many-to-many relationship in English, we also want it to work in Spanish.

Can you please help?

#1659827

Hello,

How do you setup the old relationships many-to-many model? with legacy post type relationship(_wpcf_belongs_{slug }_id) or new post type relationship?
Are you using old version of Toolset Types plugin and WPML plugin? if it is, which versions are you using?

I need to test it in my localhost. thanks

#1663955

Hi Luo.

I'm using the legacy post type relationship with the latest version of Toolset Types plugin and WPML plugin.

#1664467

Please provide your website database dump file in below private message box, also point out the child post URL and parent post URL, I need to test it in my localhost, thanks

#1665983

I have tried the package link you provided above, it is 404 error due to file size, please put the package file in your own google drive disk, and share the link only, private message box enabled again.

#1667787

I can download the file, will update here if find anything

#1668035

I can install the SQL file you provided above in my localhost, but there isn't any post are using ID 11997 or 11996 as your screenshots:
hidden link
hidden link

So I have tried the latest "Submittal Item" post(ID: 8102), there are two custom fields in it:
- wpcf-submittal-item-product-id
- wpcf-submittal-product-number-id
They seem to be post IDs of other post type, which are the old relationship we talking about.

If they are, please try these:
1) Dashboard-> WPML-> Settings-> Multilingual Content Setup
in section "Post Types Translation", find post type "Submittal Item", enable option "Translatable", save.

Then edit the "Submittal Item" posts again, you should be able to see section "Language", and you can use it to translate the "Submittal Item" post + custom fields into other languages

More help:
https://wpml.org/tutorials/2016/08/how-to-create-and-translate-custom-post-types/
section "How to translate “Custom Post Types”?"

#1676555

HI Luo. I'll try your suggestion and report back if it worked.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.