User Name Sanitization
-
Hi
When some one enter user name on Resume & Job submission form, they are able to create it with space, like allowing user name as “Shuvashish Saha”.
This is not likely to choose a standard user name.
So how could I restrict users to create user name having spaces or any other special character excluding “./_”.I have implemented this code from codex, but it’s works well if some one register via WooCommerce, but not effecting on Job & Resume submission pages.
add_filter(‘validate_username’ , ‘custom_validate_username’, 10, 2);
function custom_validate_username($valid, $username ) {
if (preg_match(“/\\s/”, $username)) {
// there are spaces
return $valid=false;
}return $valid;
}Shuavshish
The page I need help with: [log in to see the link]
- The topic ‘User Name Sanitization’ is closed to new replies.