Ultimate Member custom validation
-
I used Ultimate member 2.0.25. and I have a problem with custom validation.
I added this code in my functions.php file:
add_action(‘um_custom_field_validation_my_8numbers’,’um_custom_field_validation_my_8numbers’, 10, 3);
function um_custom_field_validation_my_8numbers( $key, $array, $args ) {
global $ultimatemember;
if ( !ctype_digit( $args[ $key ] ) || strlen( $args[ $key ] ) != 8 ) {
$ultimatemember->form->add_error($key, __(‘Enter a valid 8-number serial please’) );
}
}After that, I call this actions um_custom_field_validation_my_8numbers
on my fields in Custom Action.
Custom validation doesn’t work well. Did I make everything ok?
Thanks in advance,
Milos
The topic ‘Ultimate Member custom validation’ is closed to new replies.