Skip to content

Instantly share code, notes, and snippets.

View vdbkw's full-sized avatar

Kees vdbkw

  • Qoorts
  • Amsterdam, The Netherlands
View GitHub Profile
/**
* NL mobile phone validation
Landline: (((0)[1-9]{2}[0-9][-]?[1-9][0-9]{5})|((\\+31|0|0031)[1-9][0-9][-]?[1-9][0-9]{6}))$
Mobile: (((\\+31|0|0031)6){1}[1-9]{1}[0-9]{7})$
set css class phone field to: mobiel
*/
add_filter( 'gform_field_validation', 'validate_phone', 10, 4 );
function validate_phone( $result, $value, $form, $field ) {