um_validation_safe_username_regex not allowing me to restrict additional chars?
-
I’m trying to use the
um_validation_safe_username_regex
filter (see below) to limit registration usernames only to alphanumeric characters. I’m enacting it as a Snippet and activating it. But Ultimate Member is allowing users to continue registering with the dashes, spaces, underscores, etc.function um_custom_validation_safe_username( $regex_safe ) {
$regex_safe = '/^[A-Za-z0-9]+$/';
return $regex_safe;
}
add_filter( 'um_validation_safe_username_regex', 'um_custom_validation_safe_username', 10, 1 );Does this filter only add additional characters to allow, or can it be used to further restrict? I don’t understand why it’s not working.
- The topic ‘um_validation_safe_username_regex not allowing me to restrict additional chars?’ is closed to new replies.