Registration Custom Validation not working (Form null)
-
I am working with the new 2.0 version of UM and have also bought the Social Plugin. I am trying to perform some custom validation on a field, but throwing the error is not working as it says form is null.
add_action('um_custom_field_validation_check_fundraiser_code', 'um_action_check_fundraiser_code', 10, 3); function um_action_check_fundraiser_code( $key, $array, $args){ if ( isset( $args[$key] ) && strstr( $args[$key], '123' ) ) { UM()->form->add_error( 'fundraiser_code', 'Your username must not contain the word 123 (TEST).' ); } }
The only way I get the registration from stopping through the process is to throw the following error:
exit( wp_redirect( add_query_arg(‘err’, ‘invalid_customer_code’) ) );
However, it throws a generic error and nothing specific and doesn’t apply the error code/msg to a specific field. Anyone else have the same issues?
UM() is populated but when I try and reference UM()->form (it is null)
Thanks in advance,
Collins
- The topic ‘Registration Custom Validation not working (Form null)’ is closed to new replies.