@carlotafuro
6 years, 9 months ago
Here’s my solution:
add_filter( 'wpmu_validate_user_signup', 'my_wpmu_validate_user_signup' ); function my_wpmu_validate_user_signup( $result ) { $underscores_error_message = __( 'Sorry, usernames may not contain the character "_"!', 'buddypress' ); $error_messages_array = $result[ 'errors' ]->get_error_messages('user_name'); if ( count($error_messages_array) == 1 and $error_messages_array[0] == $underscores_error_message ) { $result[ 'errors' ]->remove('user_name'); } return $result; }