Hi @ceralis,
Sorry to know that you are having an issue.
We have deprecated some of the old hooks and filters, and that should be causing the issue at your end. Please find more details regarding the same here: https://wpmudev.com/docs/api-plugin-development/forminator-api-docs/#1-16-0-changes
To fix the issue, please try replacing the code snippet from the first URL shared with the following.
<?php
/**
* Create a custom error message
*/
add_filter('forminator_form_submit_errors', 'my_custom_form_validation', 10, 3);
function my_custom_form_validation($submit_errors, $form_id, $field_data_array) {
// Skip if is not the correct form
if((int)$form_id !== 49){
return;
}
$num1 = (int) $_POST['number-1'];
$num2 = (int) $_POST['number-2'];
// Custom error if ID already submited
if($num1 + $num2 > 6){
$submit_errors[][ 'number-1'] = __( 'The Total Can Not Be More Than 6Kg, Please Enter a Different Number' );
$submit_errors[][ 'number-2'] = __( 'The Total Can Not Be More Than 6Kg, Please Enter a Different Number' );
}
// Always return $submit_errors
return $submit_errors;
}
Please take a full backup of the website before making any changes.
Please let us know how that goes.
Kind Regards,
Nebu John