Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Benaceur

    (@benaceur)

    wordpress by default allows usernames with numbers only, our plugin allows you to not allow username to contain numbers only (Not allow use only numbers in the username)

    Thread Starter elieleloi

    (@elieleloi)

    I mean only allowing numbers, not letters or any other characters

    Plugin Author Benaceur

    (@benaceur)

    Edit this file:

    wp-content\plugins\restrict-usernames-emails-characters\classes\classe_val.php

    and in line 203 replace this:

    			if ( preg_match('/^[0-9]+$/i', $login ) || preg_match( '/^\+?\d+$/', $login ) || preg_match( '/^[0 -9]+$/i', $login ) && $this->options('p_space') != 'on' ) {
    				if ( $__valid && $this->options('p_num') ) {	
    					$this->valid_num = true;
    					return $_valid;
    				}
    			}

    by:

    			if ( !preg_match('/^[0-9]+$/i', $login )  ) {
    				if ( $__valid ) {	
    					$this->valid_num = true;
    					return $_valid;
    				}
    			}
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only numbers’ is closed to new replies.