Contact Form 7 custom validation for specific form id
<p>I'm using custom validation in Contact Form 7, but I need to validate <strong>only for a specific</strong> form, not for all my forms. This is my code:</p>

<pre><code>add_filter( 'wpcf7_validate_text*', 'my_custom_text_validation_filter', 20, 2 );
function my_custom_text_validation_filter( $result, $tag ) {

    $tag = new WPCF7_Shortcode( $tag );

    if ( 'name' == $tag-&gt;name ) { // validate name field only

        .... // my validation here

    }

    return $result;
}
</code></pre>