Last active
May 1, 2017 02:34
-
-
Save spivurno/4055175 to your computer and use it in GitHub Desktop.
Gravity Wiz: Ban/Limit Email Domains Usage Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// standard usage | |
new GWEmailDomainControl(array( | |
'form_id' => 152, | |
'field_id' => 9, | |
'domains' => array('gmail.com', 'hotmail.com', 'test.com') | |
)); | |
// all options | |
new GWEmailDomainControl(array( | |
'form_id' => 152, | |
'field_id' => 9, // multiple field IDs can be passed as an array: array(8,9) | |
'domains' => array('gmail.com', 'hotmail.com', 'test.com'), | |
'validation_message' => __('Oh no! <strong>%s</strong> email accounts are not eligible for this form.'), | |
'mode' => 'ban' // also accepts "limit" | |
)); | |
// limit mode applied to two specific fields | |
new GWEmailDomainControl(array( | |
'form_id' => 152, | |
'field_id' => 9, | |
'domains' => array('gmail.com', 'hotmail.com', 'test.com'), | |
'mode' => 'limit' | |
)); | |
// apply to all email fields on a form | |
new GWEmailDomainControl(array( | |
'form_id' => 152, | |
'domains' => array('gmail.com', 'hotmail.com', 'test.com') | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Doesn't seem to work any more. Can this be added in a plugin? i have a custom plugin that adds a functions.php file and other things and i added the code there, but it allows me to register with all blocked email addresses.