Created
October 2, 2011 10:31
-
-
Save NateJacobs/1257325 to your computer and use it in GitHub Desktop.
Check for city email during registration
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 | |
/** | |
* Check for City Email | |
* | |
* If a user tries to register with a city email address an error is returned. | |
* | |
* @author Nate Jacobs | |
* @link http://gist.github.com/1257325 | |
*/ | |
add_action( 'registration_errors', 'check_user_email',10, 3 ); | |
function check_user_email( $errors, $login, $email ) | |
{ | |
list( $addy, $domain ) = explode( "@", $email ); | |
if ( $domain == 'chandleraz.gov' ) | |
{ | |
$errors->add('empty_realname', __( '<strong>City Email Alert: </strong><br>No @chandleraz.gov email addresses allowed.' ) ); | |
} | |
return $errors; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment