• Resolved Dirk Tornow

    (@smings)


    I am looking for a way to use an external email validation for Kaliforms. Is there a filter that I can use for that? I was looking through the code, but I couldn’t find a way within the 20 apply_filter occurrences in the plugin code. Is there a section in the code where it is possible to add an apply_filter call to allow for external email validation?
    Thank you tons in advance and have a great day

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Andrei Cristea

    (@andreic86)

    Hello @smings

    You can use the following filter to stop the execution of the form processing: ‘kaliforms_before_form_process’.

    An example for this would be the following code:

    add_filter('kaliforms_before_form_process', 'your_function_goes_here');
    function your_function_goes_here($data)
    {
        // Validate here
        // $validation = run your validation here
        if ($validation === false) {
            $data['admin_external_change'] = true;
            $data['admin_stop_execution']  = true;
            $data['admin_stop_reason'] = 'Validation failed';
        }    
    
        // Remember to return $data
        return $data;
    }

    Let me know if this helped,
    Have a nice day

    Thread Starter Dirk Tornow

    (@smings)

    Awesome – works like a charm. Thank you for your instant assistance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possibility for custom field validation via filter’ is closed to new replies.