Skip Navigation

[Waiting for user confirmation] Difficulty passing Parent ID via URL redirect in Toolset Forms (Block Editor)

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 1 voice.

Last updated by Minesh 1 day ago.

Assisted by: Minesh.

Author
Posts
#2845484
toolset after submit menu.png

Tell us what you are trying to do?
I am working on a site with a Parent-Child relationship (Sedes -> Clases). My goal is to create a seamless workflow where the user creates a Parent post and is then redirected to a Child form that automatically captures the Parent ID.

I expected to find a 'Custom URL' or similar option under the 'After visitors submit this form' menu. This would allow me to manually append the Parent ID parameter to the URL of the page containing the child form. However, I cannot find the field to add URL parameters (specifically ?sede_id=[post_id]) within the Block Editor settings.

Could you please guide me on where to find this or what the best practice is for the Block Editor?

#2845503

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

What if you try to use the Toolset Form API hook: cred_success_redirect
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_success_redirect

For example:
- You can add the following code to 'custom code' section offered by Toolset:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

add_filter('cred_success_redirect', 'func_redirect_to_child_after_submit',10,3);
function func_redirect_to_child_after_submit($url, $post_id, $form_data) {
if ($form_data['id']==99999) {
$redirect = $url . "?sede_post_id" . $post_id;
return $redirect;
}
return $url;
}

Where:
- Replace 99999 with your original post ID.