Created
April 18, 2016 19:56
-
-
Save sbruner/fabf4ea4831382e8d0222186535e0d08 to your computer and use it in GitHub Desktop.
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 | |
add_filter('piklist_validation_rules', 'check_valid_number', 11); | |
function check_valid_number($validation_rules) | |
{ | |
$validation_rules['my_number'] = array( | |
'rule' => "/[-+]?[0-9]*[.,]?[0-9]+/" | |
,'message' => __('is not a number') | |
); | |
return $validation_rules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment