Skip Navigation

[Resolved] I want to import dats with relationship

This support ticket is created 5 years, 6 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 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1280495

Im' trying to import data to existing posts as a custom field in a relationship.
I have WP ALL Import and the Toolset addon.
I've read the documentation.

I have a term (terme) custom post type for french words
hidden link

I have a language (langue) custom post type
hidden link

I have a relationship call (traduction) with a custom post field (terme-traduit)

I would like to have a example of a line in CSV to import newly translated terms.

I tried this with no luck.

ID post_author post_title post_type wpcf-terme-traduit _toolset_associations_traduction
<empty> admin ballon traduction balloon {!{ballon}!}, {!{Anglais}!}

Could you guide me to the right syntax ?
PS : Balloon is the english terme for french Ballon 😉

Thanks,

#1280589

Hello,

I assume we are talking about this case:
Two post type:
- terme
- langue

Many-to-many relationship between above post types, the intermediate post type is "traduction", with a custom field:
terme-traduit

You are going to use "WP ALL Import and the Toolset addon" to import the "langue" posts:
- setup relationship with "terme" posts
- import "terme-traduit" field value at the same time

If it is, I am not sure if it is possible with WP ALL Import plugin, in Toolset side, the intermediate post type is "traduction" is actual a custom post type.

According to WP ALL Import document:
hidden link
It seems that, it can only import post of one post type, it can not import custom fields of intermediate post type at the same time.

I suggest you check it with their support:
hidden link

#1280803

Hi, thanks for the answer,

I checked here and I understand it may be possible.
Could you double-check for a solution with or without WP All Import ?

Thanks

#1281501

There isn't such a built-in feature within Toolset plugins.

In Toolset side, we can use function toolset_connect_posts() to setup many-to-many relationship between posts, see our document:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts

Output
Returns true or false. On success, also outputs the ID of the created "intermediary_post" (zero is output if none was created).

This function can output the intermediate post ID in result, so you can use it to add custom fields to intermediate post, for example:
https://codex.wordpress.org/Function_Reference/update_post_meta

As I mentioned above, you can check it with "WP ALL Import":
1) check if they are using the same function or other function
2) is there any API hook in their plugin, which you can use to add custom fields to intermediate post.