Forked from spivurno/gw-gravity-forms-email-domain-name-validator-usage.php
Created
August 15, 2013 14:37
-
-
Save jevgen/6241328 to your computer and use it in GitHub Desktop.
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