Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uzegonemad/9ef4197fb37faa3dda43 to your computer and use it in GitHub Desktop.
Save uzegonemad/9ef4197fb37faa3dda43 to your computer and use it in GitHub Desktop.
<?php
add_filter('wpbdp_form_field_html_value', 'alter_wpbdp_form_field_html_value', 10, 3);
function alter_wpbdp_form_field_html_value($value, $post_id, $class)
{
// add tel: to phone numbers
if($class->get_id() == 6) // the ID of the field to modify
{
$value = '<a href="tel:'.preg_replace('/[^0-9]/', '', $value).'">'.$value.'</a>';
}
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment