<?php
if(isset($_POST["send"]))
{
$user_login = $_POST['user_login'];
$user_name = $_POST['user_name'];
$user_lastname = $_POST['user_lastname'];
$invitation_code = $_POST['invitation_code'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
// var_dump($pass1, $pass2);
// if(strcmp ($pass1 , $pass2) != 0) {
// exit('<label class="label label-pill label-danger">Passwords do not match.</label>');
// } else {
// $pass1 = md5($pass1);
// }
if (!username_exists($user_login)) {
$userdata = array(
'user_login' => apply_filters('pre_user_user_login', $user_login),
'user_email' => apply_filters('pre_user_user_email', $user_login),
'first_name' => apply_filters('pre_user_first_name', $user_name),
'last_name' => apply_filters('pre_user_last_name', $user_lastname),
'user_nicename' => apply_filters('pre_user_user_nicename', $user_name),
'invitation_code' => apply_filters('pre_user_invitation_code', $invitation_code),
'user_pass' => $pass1,
'role' => 'subscriber',
);
$user_id = wp_insert_user($userdata);
wp_set_password ($pass1, $user_id);
]]>My use case: I use one-time invitation codes that I hand out to new users, registration is invitation-only. I also want to verify the new user’s email address. Now the worst case is that upon registration, the user mistypes their mail address and therefore isn’t able to activate their account. On the other hand the invitation code is already disabled so the user hasn’t a chance to do the registration again.
Any idea how to achieve this? Are there any hooks I can use?
]]>You can see they are unverified:
https://i.postimg.cc/jsm5GvCV/1a.png
Same time, they are active:
https://i.postimg.cc/8Thm7sJ9/2a.png
Can you please help me with this?
]]>Is it possible to achieve that using Ultimate Member?
by the way, thanks for developing this amazing plugin.
My current issue is to have a field in the registration form that would contain a specific set of characters (that are predefined by me, for example PH3f1X) that would permit a user to register.
On github I found a hint: https://gist.github.com/ultimatemember/78aac8b268b2c75489f0
But it seems to be outdated, since, after using the code, a blank screen appears. The plugin works but, instead of showing the error message, I am being redirected to a blank page.
Would You have a solution?
Thank You!
Regards,
Edgars