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,
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
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
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.