Home › Forums › Quform WordPress › Click submit -> do stuff with form data -> redirect › Reply To: Click submit -> do stuff with form data -> redirect
February 9, 2023 at 4:23 pm #35151
wp_tc_questions
Participant
FWIW, I got the functionality I was trying to achieve, thanks.
I went with configuring the confirmation redirect in the UI
Then in functions php, went with the quform_post_validate hook, and if I want to short circuit the redirect I can return an error.
add_filter(‘quform_post_validate_1’, function (array $result, Quform_Form $form) {
//do some stuff
if(//stuff did not work) {
$result = array(
‘type’ => ‘error’,
‘error’ => array(
‘enabled’ => true,
‘title’ => ”,
‘content’ => ‘It’s Broken.’
)
);
}
return $result;
}, 10, 2);