• mathew07

    (@mathew07)


    Hey,

    I’m using your awesome plugin to create registration form for new customers. I’m trying to add e-mail veryfication field to avoid mistakes. However my function doesn’t work. Can you please check it and give me some help with it?

    
    add_action('um_submit_form_errors_hook_','um_custom_validate_user_email', 999, 1);
    function um_custom_validate_user_email( $args ) {
    	global $ultimatemember;
    	$user_email = $_POST['user_email'];
    	$user_email_confirmation = $_POST['user_email_confirmation'];
    	
    	if ($user_email != $user_email_confirmation) {
    		$ultimatemember->form->add_error( 'user_email_confirmation', 'Your username must not contain the word admin.' );
    	}
    }
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • borisv

    (@borisv)

    Email verification for what mistakes?
    Did you come up with that code?

    The error msg if it should pass function check (which it doesn’t) is “Your username must not contain the word admin” which is a blacklist function on UM.

    Thread Starter mathew07

    (@mathew07)

    Hey,

    thank you for your respons. I would like to avoid customers typos.
    Yes, errorr message is wrong but it doesn’t matter because error is not showing up at all. I was trying to edit code from plugin documentation (https://docs.ultimatemember.com/article/94-apply-custom-validation-to-a-field) but I failed.

    • This reply was modified 8 years ago by mathew07.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘E-mail confirmation field’ is closed to new replies.