[ad_1]
Hello @mor3311 !
I trust you’re doing well!
We’ve recently made changes to the actions and filters in Forminator – forminator_form_after_handle_submit is no longer available because of this and instead you can use forminator_form_submit_response and/or forminator_form_ajax_submit_response and reverse the parameters.
Also – the hook you want to use here is a filter so it needs to return the $response further. You can test it instead of a redirect by enabling debugging log and logging the values like this:
So your code would look like this after modifications
add_action( 'forminator_form_submit_response', 'save_fielder_details', 10, 2);
add_action( 'forminator_form_ajax_submit_response', 'save_fielder_details', 10, 2);
function save_fielder_details($response, $form_id) {
error_log(print_r($response, true));
return $response;
}You can then run some additional code by checking:
if( $response['success'] == 1 ){
// your code here
}Hope this helps!
Warm regards,
Pawel
Hi, thanks for your response!
I tried this solution but I get the following error:
An error occurred while processing the form. Please try again
(undefined)
I actually want to save some details of the form as user_meta.
What is the right way to do this, and where should I place the code?
Hi @mor3311,
Can you please share an export of the form and the complete code you have tried so we can try to help you with this?
Please share the form’s export using Google Drive or DropBox. Please find how to export a form here:
We look forward to hearing back from you.
Kind Regards,
Nebu John
Hi, sorry for the delay!
I managed to save the data I wanted. 🙂
Thanks for your answer!!
