Black Friday Super Sale! 🔥 Enjoy a jaw-dropping discount of up to 50% OFF on all Nextend Social Login plans. Hurry, the offer ends on December 3rd!
Buy now

How to add custom username validation logic?

You can add custom validation to the entered username using the nsl_validate_username filter.

Example

Code
add_filter('nsl_validate_username', function ($isValid, $username, $errors) {
    if (strlen($username) < 6) { $errors->add('invalid_username', '' . __('ERROR') . ':' . __('Sorry, username must contain at least 6 characters.'));
        $isValid = false;
    }
    return $isValid;
}, 10, 3);

Available since: 3.0.7

🍪 We use cookies!

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. You can manage your preferences or learn more in our Cookie Policy.

Accept all
Reject all
Cookie Policy