I had a similar issue and tried to use the solution proposed by Carl
however it doesn't work for me... I have a registration form (the form ID is 2)
I placed this code in my functions
function sg_regform_redirect( $form_tag, $form ) {
$form = 2;
$form_tag = preg_replace( '|action="(.*?)"|', 'action="' get_bloginfo( 'url' ) . '/register' . '"', $form_tag);
return $form_tag;
}
add_filter( 'gform_form_tag', 'sg_regform_redirect', 10, 2);
I tested the form and it doesn't redirect to the page indicated, it just runs as usual. despite there are errors or not
I also tried to hardcode the page to redirect the form action to, but no difference
maybe I'm handling the $form value incorrectly? I only want this filter to apply on a specific form with ID = 2.
can you help me?
thank you
Posted 12 years ago on Saturday July 28, 2012 |
Permalink