Skip Navigation

[Resolved] Connect field group to parent with php

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 1 reply, has 1 voice.

Last updated by Mario 6 years, 2 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);