Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Author: David Smith
- // http://www.gravityhelp.com/forums/topic/disable-duplicate-email-check-snippet#post-91521
- // http://www.gravityhelp.com/forums/topic/multisite-register-users?replies=2#post-129695
- /**
- * Gravity Forms User Registration validates a number of fields. This snippet allows you to override the validation for
- * duplicate emails. This is useful when using the "Allow Multiple Accounts" plugin.
- */
- add_filter('gform_user_registration_validation', 'unvalidate_duplicate_email', 10, 2);
- function unvalidate_duplicate_email($form, $config) {
- // update the 1 here to your form ID
- if($form['id'] != 1)
- return $form;
- $email_field_id = rgars($config, 'meta/email');
- foreach($form['fields'] as &$field) {
- if($field['id'] == $email_field_id && $field['validation_message'] == 'This email address is already registered')
- $field['failed_validation'] = false;
- }
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement