Home › Forums › Quform WordPress › automatically activate and login user after register
This topic is: resolved
- This topic has 3 replies, 2 voices, and was last updated 5 years, 5 months ago by
jennis015.
Viewing 4 posts - 1 through 4 (of 4 total)
- AuthorPosts
- November 11, 2019 at 11:33 pm #30201
jennis015
ParticipantHI! I wanted to automatically activate and login user after registration on my site using quform is there a way? now i have create the user with this code and it appear like pending user and not logged in.
add_action('quform_post_process_5', function (array $result, Quform_Form $form) { if (function_exists('bp_core_signup_user')) { $username = $form->getValueText('quform_5_44'); $email = $form->getValueText('quform_5_44'); $password = $form->getValueText('quform_5_16'); // Profile fields $usermeta = array( 'field_1' => $form->getValueText('quform_5_16'), 'field_43' => $form->getValueText('quform_5_44'), ); $usermeta['profile_field_ids'] = '1,43'; $usermeta['password'] = wp_hash_password($password); bp_core_signup_user($username, $password, $email, $usermeta); } return $result; }, 10, 2);
`
November 12, 2019 at 10:43 am #30221Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 13, 2019 at 1:43 am #30225jennis015
ParticipantHi ally
i added this after the code of registration:add_filter('quform_post_process_5', function (array $result, Quform_Form $form) { wp_signon(array( 'user_login' => $username, 'user_password' => $password, 'remember' => true ), false); return $result; }, 10, 2);
but itsnt works. something is wrong? thanks!
November 14, 2019 at 10:28 am #30226jennis015
ParticipantSolved!! thanks!
- AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.