The contact-form-7 wpcf7 validation error hook.
Published Date - July 22, 2023
return apply_filters( 'wpcf7_validation_error', $error, $name, $this );
$error
$name
$instance
The following example is for adding a hook callback.
// define the wpcf7_validation_error callback
function custom_wpcf7_validation_error( $error, $name, $instance ){
//custom code here
return $error
}
//add the action
add_filter('wpcf7_validation_error', 'custom_wpcf7_validation_error', 10, 3)
The filter is defined in the following location(s).
contact-form-7/includes/contact-form.php
return apply_filters( 'wpcf7_validation_error', $error, $name, $this );