Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // originally https://gist.github.com/richardvav/7961308
- // Usage: add to your theme's functions.php file
- // log field validation errors
- add_filter('gform_validation', 'log_validation_failure');
- function log_validation_failure($validation_result){
- $form = $validation_result["form"];
- foreach($form["fields"] as &$field){
- if( $field["failed_validation"] )
- GFCommon::log_error("form #{$form["id"]}: validate() - failed: {$field["label"]}({$field["id"]} - {$field["type"]}) - message: {$field["validation_message"]}");
- }
- return $validation_result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement