Forum Replies Created

Viewing 1 replies (of 1 total)
  • Many thanks cutescar2nis.

    I’d make one small clarification/correction in Step 1, Part 2.

    You say that you inserted this code:

    'invalid_digit' => array(
    'description' => __( "There is a field that sender is needed to fill in with numbers", 'wpcf7' ),
    'default' => __( 'Please fill the required field with numbers.', 'wpcf7' )
    )

    after this code:

    'invalid_required' => array(
    'description' => __( "There is a field that sender is needed to fill in", 'wpcf7' ),
    'default' => __( 'Please fill the required field.', 'wpcf7' )
    ),

    It is important to note, that the comma (,) after the last parenthesis in the existing code is necessary and must be added. Without it your code may not work.

    In short, make sure line 38 in functions.php is ),

    I also changed the regular expression to accept parenthesis and whitespaces so I can accept numbers in the format +64 123 456, (03) 456 7890. My is_telnum function now looks like this:

    function is_telnum($telnum)
    {
    	$regexp = '/^[0-9\+\-\)\(\d\s]{7,}$/';
    
    	if(preg_match($regexp, $telnum))
    		return true;
    	else
    		return false;
    }

    Lastly, please note that you may want to make a backup of the ContactForm7 plugin, as this modification will likely be overwritten when you do a one-click upgrade of the plugin. Let’s hope the maker of ContactForm7 adds this feature.

Viewing 1 replies (of 1 total)