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);
}
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