Home › Forums › Quform WordPress › Popup not working in WP
- This topic has 4 replies, 2 voices, and was last updated 4 years, 5 months ago by felixvelarde.
- AuthorPosts
- June 13, 2020 at 12:44 pm #31514felixvelardeParticipant
Hello. The popup in the following page doesn’t work – I’ve unloaded all non-QuForm JS code on this page, tried disabling all the other plugins including WP-Rocket, Boxzilla, SEO etc. Still no joy. Any ideas?
https://2y3x.com/uncategorized/test-for-popup/
Thanks!
June 15, 2020 at 11:29 am #31517AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 15, 2020 at 11:34 am #31519felixvelardeParticipantThanks Ally – I got it working in the end. It was my fault, conflict with a separate JS.
I am struggling with getting the User Registration to add the user role to the newly registered user – I’m using the code you suggested but while FirstName and LastName are updating, Role isn’t. Can you show me where I’ve got it wrong please? Much appreciated!
This is the page:
https://2y3x.com/videos/lockdown22052020/add_filter(‘quform_element_valid_7_4’, function ($valid, $value, Quform_Element_Field $element) {
if (username_exists($value)) {
$element->addError(‘This username is already taken’);
$valid = false;
}return $valid;
}, 10, 3);add_filter(‘quform_element_valid_7_7’, function ($valid, $value, Quform_Element_Field $element) {
if (email_exists($value)) {
$element->addError(‘This email is already registered’);
$valid = false;
}return $valid;
}, 10, 3);add_action(‘quform_post_process_7’, function (array $result, Quform_Form $form) {
$username = $form->getValueText(‘quform_7_4’);
$email = $form->getValueText(‘quform_7_7’);
$password = $form->getValueText(‘quform_7_5’);$userId = wp_insert_user(array(
‘user_login’ => $username,
‘user_pass’ => $password,
‘user_email’ => $email
));
update_user_meta($userId, ‘first_name’, $form->getValueText(‘quform_7_3’));
update_user_meta($userId, ‘last_name’, $form->getValueText(‘quform_7_9’));
update_user_meta($userId, ‘role’, $form->getValueText(‘quform_7_8’));
wp_signon(array(
‘user_login’ => $username,
‘user_password’ => $password,
‘remember’ => true
));
return $result;
}, 10, 2);June 16, 2020 at 9:58 am #31528AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 16, 2020 at 1:07 pm #31534felixvelardeParticipantThank you, that works 🙂
- AuthorPosts
- You must be logged in to reply to this topic.