Hook before user is created and make some custom validation
You need to add , 10, 3 after your closure to set the hook priority and (more importantly) the number of accepted arguments – otherwise $user_email and $errors will not be passed. add_action( ‘register_post’, function ( $user_login, $user_email, $errors ) { $userIsValid = ValidateUser::make($errors); if(!$userIsValid) { $errors->add( ‘bad_email_domain’, ‘<strong>ERROR</strong>: errors’ ); } }, 10, 3 … Read more