Skip to content

Instantly share code, notes, and snippets.

@nextend
Created April 25, 2018 06:09
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 nextend/b92d305166de3beca71606845994cd1a to your computer and use it in GitHub Desktop.
Save nextend/b92d305166de3beca71606845994cd1a to your computer and use it in GitHub Desktop.
<?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