function userprotect_add_validation in User protect 5
Same name and namespace in other branches
- 6 userprotect.module \userprotect_add_validation()
Adds a validation function to a validation handler.
Parameters
$element The initial validation handler.:
$validation The validation function to add.:
Return value
The validation handler with the new validation function merged in.
1 call to userprotect_add_validation()
- userprotect_form_alter in ./
userprotect.module - Alters forms for user protection.
File
- ./
userprotect.module, line 261
Code
function userprotect_add_validation($element, $validation) {
// If it's already an array, prepend our custom validation function.
if (is_array($element)) {
$form = $validation + $element;
}
else {
$form = $validation;
}
return $form;
}