wpcf7_validation_error

The contact-form-7 wpcf7 validation error hook.

Published Date - July 22, 2023

Description

return apply_filters( 'wpcf7_validation_error', $error, $name, $this );

Parameters

  1. $error

  2. $name

  3. $instance


Usage

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)

Defined

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 );