'.__("Error","sakura")./*错误*/':'.__("Please enter username.","sakura")./*请输入用户名。*/'
';
} elseif ( ! validate_username( $sanitized_user_login ) ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("Invalid characters, please enter a valid username.","sakura")./*此用户名包含无效字符,请输入有效的用户名。*/'
';
$sanitized_user_login = '';
} elseif ( username_exists( $sanitized_user_login ) ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("This username has been registered.","sakura")./*该用户名已被注册。*/'
';
}
// Check the e-mail address
if ( $user_email == '' ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("Please enter email address.","sakura")./*请填写电子邮件地址。*/'
';
} elseif ( ! is_email( $user_email ) ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("Invalid email address.","sakura")./*电子邮件地址不正确。*/'
';
$user_email = '';
} elseif ( email_exists( $user_email ) ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("This email address has been registered.","sakura")./*该电子邮件地址已经被注册。*/'
';
}
// Check the password
if(strlen($_POST['user_pass']) < 6){
$error .= ''.__("Error","sakura")./*错误*/':'.__("Password length is at least 6 digits.","sakura")./*密码长度至少6位。*/'
';
}elseif($_POST['user_pass'] != $_POST['user_pass2']){
$error .= ''.__("Error","sakura")./*错误*/':'.__("Inconsistent password entered twice.","sakura")./*两次输入的密码不一致。*/'
';
}
// verification
if(akina_option('login_validate') && strlen($_POST['verification']) > 0 ){
$error .= ''.__("Error","sakura")./*错误*/':'.__("Please drag the slider to verify identity","sakura")./*请拖动滑块验证身份*/'
';
}
if($error == '') {
$user_id = wp_create_user( $sanitized_user_login, $_POST['user_pass'], $user_email );
if ( !$user_id ) {
$error .= ''.__("Error","sakura")./*错误*/':'.__("Unable to complete registration request...Please contact","sakura")./*无法完成注册请求... 请联系*/''.__("administrator","sakura")./*管理员*/'!
';
}else if (!is_user_logged_in()) {
$user = get_userdatabylogin($sanitized_user_login);
$user_id = $user->ID;
// 自动登录
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action('wp_login', $user_login);
}
}
}
?>