Notifications
Clear all

wpForo 1.x.x [Closed] How To Limit Username to 5 Characters

2 Posts
2 Users
0 Reactions
2,348 Views
Posts: 3
 jmkt
Topic starter
(@jmkt)
Active Member
Joined: 7 years ago

Instead of 3-15 characters I would like usernames to be between 3-5 characters long.  Can you explain how to go about this please?

Regards,

jmkt

1 Reply
Robert
Posts: 10587
Admin
(@robert)
Support Team
Joined: 9 years ago

You can customize wpForo template files. Particularly the in register.php in update save way.

wpForo theme files:

https://wpforo.com/docs/root/forum-themes/theme-files/

wpForo theme customization:

https://wpforo.com/docs/root/forum-themes/theme-customization/

Find this line:

<td class="wpf-register-field"><input autofocus required="TRUE" type="text" value="<?php echo esc_attr($user_login) ?>" name="wpfreg[user_login]" class="wpf-register-text wpfw-70" maxlength="30" /></td>

Change to this:

<td class="wpf-register-field"><input autofocus required="TRUE" type="text" value="<?php echo esc_attr($user_login) ?>" name="wpfreg[user_login]" class="wpf-register-text wpfw-70" maxlength="5" /></td>