Username Spaces 2.5.3 Error
-
I’m currently using this code snippet to stop users from registering with spaces in usernames. However, in 2.5.3 it causes a fatal error can anyone help?
add_filter ( ‘sanitize_user’, ‘my_um_remove_user_spaces’, 10, 3); function my_um_remove_user_spaces( $username, $raw_username, $strict = false ) { if( strpos( trim( $username ), ‘ ‘ )) { UM()->form()->add_error( ‘user_login’, __( ‘You are not allowed to have spaces in your username.’, ‘ultimate-member’ ) ); } return $username; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Username Spaces 2.5.3 Error’ is closed to new replies.