Title: Ultimate Member custom validation
Last modified: August 30, 2018

---

# Ultimate Member custom validation

 *  [milosgoweb](https://wordpress.org/support/users/milosgoweb/)
 * (@milosgoweb)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/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
    -  This topic was modified 7 years, 11 months ago by [milosgoweb](https://wordpress.org/support/users/milosgoweb/).

The topic ‘Ultimate Member custom validation’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [milosgoweb](https://wordpress.org/support/users/milosgoweb/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/ultimate-member-custom-validation/)
 * Status: not resolved