Created
April 25, 2018 06:09
-
-
Save nextend/b92d305166de3beca71606845994cd1a to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
Plugin Name: Nextend Social Login - Username length | |
*/ | |
add_filter('nsl_validate_username', function ($isValid, $username, $errors) { | |
if (strlen($username) < 6) { | |
$errors->add('invalid_username', '<strong>' . __('ERROR') . '</strong>:' . __('Sorry, username must contain at least 6 characters.')); | |
$isValid = false; | |
} | |
return $isValid; | |
}, 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment