Hi @jamminjames
I hope you are doing well today.
I pinged our SLS Team to review your query what will be possible in this case. We will post an update here as soon as more information is available.
Kind Regards,
Kris
Hi again @jamminjames
add_filter( 'forminator_form_submit_response', 'wpmudev_fix_response_url_redirect', 20, 2 );
add_filter( 'forminator_form_ajax_submit_response', 'wpmudev_fix_response_url_redirect', 20, 2 );
function wpmudev_fix_response_url_redirect( $response, $form_id ) {
if ( $form_id != 6 ) {
return $response;
}
if ( ! empty( $response['url'] ) ) {
$response['url'] = urldecode($response['url']);
$response['url'] = str_replace('&', '&', $response['url']);
}
return $response;
}
You need to change 6 to your form ID. You can find your form ID in page source where form is located, or edit your form in WP Dashboard and URL of that page edit will contain that ID.
Kind Regards,
Kris
Wouldn’t this work in a child theme’s functions.php file as well?
Hello @jamminjames ,
Yes, it should work, but it’s better to use MU plugin.
kind regards,
Kasia
Just curious, why is that considered to be better?
Hi @jamminjames
MU (Must Use) plugins are separate (or “independent”) from themes. A code added as MU plugin will not be overwritten/removed upon theme update and will remain there active and working even if you switch theme (for good or just temporarily for testing) to some other one.
It also is easier to maintain and troubleshoot in future as it’s clear that the code is actually not a part of the theme and it’s often simply easier to find and identify such code.
MU plugins are also loaded by PHP before all other plugins are loaded which, in many cases, may actually be useful and helpful (e.g. if “priority matters” for the executed code).
But, as my colleague already mentioned, this particular code should also work fine if added to “functions.php” so if you prefer to use it like that – there’s nothing in a way 🙂
Best regards,
Adam
Okay, thanks! We’re using it in functions.php and it’s working fine.