Skip Navigation

[Resolved] Connect field group to parent with php

This support ticket is created 5 years, 7 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.

This topic contains 1 reply, has 1 voice.

Last updated by Mario 5 years, 7 months ago.

Author
Posts
#1106372

I have parent cpt 'region' and child cpt 'province'. cpt province as custome field group for the parent 'region'.
Both cpt are importet in DB with wp_insert_post. So far, so good.
Now i want connect each province cpt as a custom field groups to its belonging parent 'region'.

I tried

toolset_connect_posts ('region-province', $region_post->ID, $province_post->ID);

Since i don´t know the name of relationship i guessed 'region-province', 'region' and 'province'. Nothing worked for me.

What i am doing wrong?
I followed all available documentations for apis.

#1106376

Solution was: toolset_connect_posts ('province', $region_post->ID, $province_post->ID);

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