I am trying to restrict a certain combination of characters in a user name while they register.

I have restricted user names to numeric characters only, but now I am not getting a way out to restrict certain combination & numeric values for user names.

Here is the code I'm using, which enforces numeric only user names:

'username' => array(
                'label' => __('Username', 'peepso-core'),
                'descript' => __('Numeric Username Only, Best would be Your Mobile Number', 'peepso-core'),
                'value' => $input->val('username', ''),
                'required' => 1,
                'validation' => array(
                    'minlen:' . PeepSoUser::USERNAME_MINLEN,
                    'maxlen:' . PeepSoUser::USERNAME_MAXLEN,

Please suggest what can be done.

  • Where are you using this array? I'm not familiar with any WordPress mechanism that accepts such data in order to customize registration. – bosco Mar 5 '18 at 2:57
  • @bosco i have a plugin called PeepSo and it uses the individual registration form, where i want to restrict username combination like 0000000001 and so on, any kind of combination which is not normal. – Pawan Kumar Mar 7 '18 at 5:22
  • I am leaving this question open because i am not able to get answer even i have done every experiment. nothing is coming out – Pawan Kumar Mar 7 '18 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.