• Resolved strannaja911

    (@strannaja911)


    I use custom validation email addresses on my site.

    function payrollms_email_validation_filter($result, $tag){
        if ( isset($_POST['_wpcf7']) && $_POST['_wpcf7'] == 14999){
        $field_name = 'email-payroll-ms';
        $tag = new WPCF7_Shortcode($tag);
        if ($field_name == $tag->name) {
            $the_value = isset($_POST[$field_name]) ? trim($_POST[$field_name]) : "";
            if (!payroll_business_email($the_value)) {
                $result->invalidate($tag, "Please enter a valid business email");
            }
        }}
        return $result;
    }
    add_filter('wpcf7_validate_email', 'payrollms_email_validation_filter', 10, 2);
    add_filter('wpcf7_validate_email*', 'payrollms_email_validation_filter', 10, 2);

    and with this code I got 500 error

    wp-admin/admin-ajax.php?action=cf7mls_validation 500 (Internal Server Error)

    • This topic was modified 3 years, 6 months ago by strannaja911.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Ajax 500 error when use custom validation email’ is closed to new replies.