Skip Navigation

[Resolved] Redirect dynamically link from a "form" to an "edit form" in a content template

This support ticket is created 2 years, 5 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 2 voices.

Last updated by youssefe 2 years, 5 months ago.

Assisted by: Shane.

Author
Posts
#2199617

Tell us what you are trying to do?
I'm trying to modify the code below so i can redirect from a form in a page or a content template to an other editing form holding place in an other content template
Is there any documentation that you are following? (a code snippet for redirect succeed
add_filter('cred_success_redirect', 'stegvis_skjema_el_test',10,3);
function stegvis_skjema_el_test($url, $post_id, $form_data)
{
if ($form_data['id']==874)
{
$arr = array('content-template-id'=>925); //the step 2 CRED form template ID
$url = add_query_arg($arr, $url);
}
return $url;
}

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2199997

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

Based on what I see here, you want to reload the current page however you want it to load with the content template that has the edit form ?

Please provide a bit more clarity for me as i'm not sure the reason for wanting to have the page redirect to the edit form page when the form is just submitted.

Thanks,
Shane

#2200013

thanks for ur reply
sorry i will explain it better :
i have an edit form "a" in a content template "aa"
and an other edit form "b" in an other content template "bb"
i want to : when submitting the edit form "a" would take me directly to edit form "b" in the content template "bb"

#2201031

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Ok I understand now. However in order for this to happen we would need to know the Post link for the post that you want to edit with edit for BB. This is because the post URL gains the additional content template parameter when you are requesting the edit form.

Right now in the redirect hook you're essentially just constructing the URL parameter. There isn't any URL to attach it to, essentially your end result should look like.

hidden link

Thanks,
Shane

#2201053

thanks
the thing is the "linktopost" isn't a fixed link , it changes according to the login user who has created that post
ex :
jack has created a Customs post called "jack-cv" then the link would be hidden link
mery has created Custom post called "mery-cv" then the link would be hidden link
so the "linktopost" would change according to the login user
so : what is the redirect hook that could achieve this result

#2201749

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Yes this I understand but how is it that you will get the jack-cv in the link.

Secondly the Post that the user is creating currently is it the post for their CV? Meaning is it that after the user creates the post you want to redirect them to the edit form for that post they've just created?

Please let me know.
Thanks,
Shane

#2201813

hello there
My initial demand was : i want to redirect CV creators after submitting form "a" , to an other edit form "b" holding place in an other content template to edit the same CV (actually an other part of the CV) because the process of creating CV is too long and needs to be separated to parts (a,b,..)
So i did some search and find out that there is a hook to do that :

 
add_filter('cred_success_redirect', 'stegvis_skjema_el_test',10,3);
function stegvis_skjema_el_test($url, $post_id, $form_data)
{
if ($form_data['id']==874)
{
$arr = array('content-template-id'=>925); //the step 2 CRED form template ID
$url = add_query_arg($arr, $url);
}
return $url;
}
 

My problem is : I don't know how to modify the hook above to do so
So please read the note carefully so u can understand it correctly
Ps: Please can u be more quick at ur responses, because i have a holding project here and 1 day delay for each response is out of my schedule
best regards

#2201925

My issue is resolved now. Thank you!

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