Title: Validation change
Last modified: May 2, 2022

---

# Validation change

 *  Resolved [readyallcz](https://wordpress.org/support/users/readyallcz/)
 * (@readyallcz)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/validation-change/)
 * Hello, I need to update a validation function in validation-functions.php file.
 * I dont want to lose these changes with future updates. Is there any way I can
   override this function, i.e. in my child theme functions.php? This is the original
   function I need to override.
 *     ```
       function wpcf7_is_tel( $tel ) {
       	$pattern = '%^[+]?' // + sign
       		. '(?:\([0-9]+\)|[0-9]+)' // (1234) or 1234
       		. '(?:[/ -]*' // delimiter
       		. '(?:\([0-9]+\)|[0-9]+)' // (1234) or 1234
       		. ')*$%';
   
       	$result = preg_match( $pattern, trim( $tel ) );
       	return apply_filters( 'wpcf7_is_tel', $result, $tel );
       }
       ```
   
 * Thank you for any help.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Ian Sackofwits](https://wordpress.org/support/users/plantprogrammer/)
 * (@plantprogrammer)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/validation-change/#post-15614533)
 * Hi, readyallcz, I’m another CF7 user.
 * You can hook into the `wpcf7_is_tel` filter like the following:
 *     ```
       // define the callback function 
       function filter_wpcf7_is_tel( $result, $tel ) { 
           // manipulate the result 
           return $result; 
       }; 
   
       // add the filter 
       add_filter( 'wpcf7_is_tel', 'filter_wpcf7_is_tel', 10, 2 );
       ```
   
 *  Thread Starter [readyallcz](https://wordpress.org/support/users/readyallcz/)
 * (@readyallcz)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/validation-change/#post-15615105)
 * Hello, thank you for your help.
 * Code is working exactly as I needed.
 * Have a nice day.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Validation change’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [readyallcz](https://wordpress.org/support/users/readyallcz/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/validation-change/#post-15615105)
 * Status: resolved