Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jevgen/6241328 to your computer and use it in GitHub Desktop.
Save jevgen/6241328 to your computer and use it in GitHub Desktop.
<?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