Created
January 18, 2014 20:02
-
-
Save teolopez/8495440 to your computer and use it in GitHub Desktop.
// Register Error if ID code does not match. for functions.php
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
//---------------------------------------------- | |
// Register Error if ID code does not match. | |
//---------------------------------------------- | |
function myplugin_check_fields($errors, $sanitized_user_login, $user_email) { | |
$mystring = $user_email; | |
$findme = '.edu'; | |
$pos = strpos($mystring, $findme); | |
if ( ! $pos === false) | |
$errors->add( 'email_domain_error', __('<strong>ERROR</strong>: Please provide a non .edu email.','mydomain') ); | |
//if ( ! preg_match('/^(\d{5}(\d{4})?)?$/', $_POST['registrationcode']) ) | |
//$registerKey = $_POST['registrationcode']; | |
//if ( ! $registerkey == '123' ) | |
if ( ! preg_match('/^7891gza!/', $_POST['registrationcode']) ) | |
$errors->add( 'registerkey_error', __('<strong>ERROR</strong>: Enter a valid registration code.','mydomain') ); | |
return $errors; | |
// if ( strpos('.edu', $_POST['user_email']) ) | |
// $errors->add( 'email_domain_error', __('<strong>ERROR</strong>: Please provide a non .edu email.','mydomain') ); | |
// return $errors; | |
// if ( ! preg_match('/^(\d{5}(\d{4})?)?$/', $_POST['registrationcode']) ) | |
// $errors->add( 'registerkey_error', __('<strong>ERROR</strong>: Enter a valid registration code.','mydomain') ); | |
// return $errors; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment