Skip Navigation

[Resolved] Gravity forms post relationship

This support ticket is created 4 years, 10 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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 4 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1499049

Tell us what you are trying to do?
I've got a parent child relationship (employee and checkin). I am trying to submit the parent value with the submission with gravity forms, but I can't seem to find any documentation for the same.

Is there any documentation that you are following?
https://toolset.com/forums/topic/gravity-forms-and-post-relationships/

Currently using:
add_action( 'gform_after_submission_1', 'employee_to_checkin', 10, 2 );
function employee_to_checkin( $entry, $form ) {
$parentpost = 135;
$childpost = $entry["post_id"];
toolset_connect_posts('employee-checkin', $parentpost, $childpost);
}

#1501311

Hi,

Thank you for contacting us and I'd be happy to assist.

Your custom function seems to be correct and if it isn't working, you can troubleshoot around the following points:

1. Please make sure that your target form's ID is 1 as you're using "gform_after_submission_1".
( ref: hidden link )

2. The variables "$parentpost" and "$childpost" contains the correct IDs of the parent and child posts.

3. The "employee-checkin" is the correct slug for your target post-relationship.

4. Your target post-relationship type allows more child posts to be assigned to the parent post with ID 135.

In case the issue still persists, you can turn on WordPress debugging ( ref: https://wordpress.org/support/article/debugging-in-wordpress/ ) and see if any errors or warnings are shown on screen or in the server's error logs.

regards,
Waqar