Home › Forums › Quform WordPress › WordPress login data for new user and name problems
- This topic has 2 replies, 2 voices, and was last updated 3 years, 11 months ago by BarbRoos.
- AuthorPosts
- February 14, 2021 at 10:43 am #32541BarbRoosParticipant
Hello,
I just purchased two licenses for your form plugin and I love it!
With your intructions on the forum I created a register page for WordPress, got the new user to show up in the User profile backend of wordpress and login and redirect when a user registers.
But the new user is not getting their new account login data in the mail they used to register. And the name and surname showed up before in the new profile, but now they don’t anymore.
How can I fix this?
This is the code I used:
‘add_filter(‘quform_element_valid_2_24’, function ($valid, $value, Quform_Element_Field $element) {
if (username_exists($value)) {
$element->addError(‘Deze gebruikersnaam bestaat al’);
$valid = false;
}return $valid;
}, 10, 3);add_filter(‘quform_element_valid_2_18’, function ($valid, $value, Quform_Element_Field $element) {
if (email_exists($value)) {
$element->addError(‘Dit email adres is al geregistreerd’);
$valid = false;
}return $valid;
}, 10, 3);add_action(‘quform_post_process_2’, function (array $result, Quform_Form $form) {
$username = $form->getValueText(‘quform_2_24’);
$email = $form->getValueText(‘quform_2_18’);
$password = $form->getValueText(‘quform_2_22’);$userId = wp_insert_user(array(
‘user_login’ => $username,
‘user_pass’ => $password,
‘user_email’ => $email
));update_user_meta($userId, ‘Voornaam’, $form->getValueText(‘quform_2_25’));
update_user_meta($userId, ‘Achternaam’, $form->getValueText(‘quform_2_26’));wp_signon(array(
‘user_login’ => $username,
‘user_password’ => $password,
‘remember’ => true
));return $result;
}, 10, 2);’Regards,
BarbFebruary 16, 2021 at 12:34 pm #32556AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
February 16, 2021 at 1:38 pm #32558BarbRoosParticipantWonderful, thank your very much Ally, it worked! 😀
Regards,
Barb - AuthorPosts
- You must be logged in to reply to this topic.