Skip Navigation

[Resolved] Multistep Form Redirects

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)


The setup:
Post types: Landlord (parent) --> Property (child)
Property (parent) --> Property Review (child)
Landlord (parent) --> Landlord Review (child)

I need to create a form which is a review of both the property and the landlord that is the parent of that property. One should lead into the other.

You go to a page for the property: and click on "Review".
That takes you to the first form:
Once you submit that, you should automatically (through some cred_success_redirect magic I assume) be taken to the form to review the landlord for that same property (the parent of the post you just reviewed).

What variables can I use to accomplish this and what does it look like? Many thanks.



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)


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

What you're trying to achieve is possible and you're thinking along the right lines.

1. You'll create two separate pages, one for each review post form:

a). Rate Property

b). Rate Landlord

2. The parent relationship field in those forms, will be set to link to a URL parameter to read the parent post's ID.

For example, for the rate property form:

And for the rate landlord form:

3. The first "Review" link on the single property page will simply need the [wpv-post-id] shortcode, to pass the current property post's ID:
( ref: )[wpv-post-id]

4. For the next step of redirecting to the second page "Rate Landlord", you'll use the "cred_success_redirect" filter:
( ref: )

In this filter's function, you can get the ID of the target "property" post through the URL parameter "target-property-id" by using the super global '$_GET' ( $_GET['target-property-id']" ).
( ref: hidden link )

And once you have the ID of the property, you can get the ID of its parent "landlord" post, by using the "toolset_get_related_posts" function:

That ID of the related parent landlord post can then be set in the final redirect URL so that on submission of the first form, the user is redirected to the second form page, with the correct URL parameter value of the landlord.

I hope this helps and please let me know if you need any further assistance with this.



Thank you for the detailed response.
Do you have any examples of that the functions.php file would look like to achieve this?



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

We don't have a copy/paste file/snippet available for this, but I can assist you with some pointers on how to make the custom code work.

Can you please share temporary admin login details, along with the link to the pages where these forms can be seen?

I'll be in a better position to suggest the next steps, accordingly.

Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access details.

I'll be performing some tests on my website with a similar setup and will share the findings with you as soon as I can.

Thank you for your patience.



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting, as we had an unusually busy forum queue.

I've performed some testing on my website with a similar setup and here is an example of the code snippet, for the redirection code:

add_filter('cred_success_redirect', 'custom_redirect_property_rating_form',10,3);
function custom_redirect_property_rating_form($url, $post_id, $form_data)
	// check if specific form
	if ($form_data['id']==197) {
		if(!empty($_GET['parent_rental_id'])) {
			// get the parent manager post ID
			$get_results = toolset_get_related_posts( $_GET['parent_rental_id'], 'property-manager-property', 'child', 1, 0, array(), 'post_id', 'parent' );
			// if found append it in the URL parameter 'parent_manager_id'
			if(!empty($get_results)) {
				$url = $url.'?parent_manager_id='.$get_results[0];

	return $url;

This function will be executed when your website's "Property Rating (Step 1)" form (ID: 197) will be submitted. It will get the ID of the target property from the URL parameter 'parent_rental_id', get its related parent 'property manager' post ID and set it in the redirection URL, in the parameter 'parent_manager_id'.

Important: The form "Property Rating (Step 1)" is currently set to show a message instead of the form, when the form is submitted. To make this redirection code work, make sure that this option is set to redirect to the next rating form page, which is "Rate Manager".


That did the trick. Many thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.