Last active
February 16, 2016 17:40
-
-
Save brandonstephens/084f72660437889d7e83 to your computer and use it in GitHub Desktop.
Phone Number or Empty Validation Patter for Advanced Custom Fields: Validated Field - Choose PHP Statement
This file contains hidden or 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 | |
if ( preg_match('/^\d{3,3}-\d{3,3}-\d{4,4}$/', $value) || strlen($value) == 0 ) { | |
return true; | |
} else { | |
return false; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment