Created
October 20, 2021 11:45
-
-
Save imuhammadshoaib/fe7b4146537ba2419e0deb246d0848c0 to your computer and use it in GitHub Desktop.
Custom Validatation For Phone Number Field Contact Form 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_filter_wpcf7_is_tel( $result, $tel ) { | |
$result = preg_match( '/^(?:0)\d{9}+$/', $tel ); | |
return $result; | |
} | |
add_filter( 'wpcf7_is_tel', 'custom_filter_wpcf7_is_tel', 10, 2 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment