WordPress login data for new user and name problems

Home Forums Quform WordPress WordPress login data for new user and name problems

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32541
    BarbRoos
    Participant

    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,
    Barb

    #32556
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #32558
    BarbRoos
    Participant

    Wonderful, thank your very much Ally, it worked! 😀

    Regards,
    Barb

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2020 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy