Skip Navigation

Relationships between custom post type to front-end form

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 4 replies, has 2 voices.

Last updated by michalB-6 3 months, 1 week ago.

Assigned support staff: Minesh.


Tell us what you are trying to do?

I'm building a directory site. I created a form for adding ads by front-end users. In this form, users have to choose Producer and Model (both are CPT and required fields). The problem is when the user adds his ad and choice Producer and model the relationship between these posts isn't created and when someone uses filters on the ads page this ad isn't presented. How can I add the relationship form to Post Form on Front-end?

Is there any documentation that you are following?



Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know that you are using the post form created with Toolset Forms to create a new entry from frontend for your post type where you added the post reference fields which allow you to select the parent - right?
Are you using the post relationship form?

If you can share problem URL and admin access details that would help to me review your current setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.


Hi Minesh,
yes I'm using the Post Form (not relationship form) created with Toolset Forms to create a new entry from front-end where I have two Post reference filed. Right now I resolved this by adding this pice of code:

add_action('cred_save_data', static function(int $post_id, array $form_data): void {
    toolset_connect_posts('ad-model', $post_id, $_POST['model']);
    toolset_connect_posts('ad-producer',$post_id, $_POST['producer']);

But I think there is a better way to do this.



Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes, this is the right hook you are using and right function to connect the post.


My issue is resolved now. Thank you!