Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theeventscalendar/5e0c589f8f9f16dddbe6 to your computer and use it in GitHub Desktop.
Save theeventscalendar/5e0c589f8f9f16dddbe6 to your computer and use it in GitHub Desktop.
Make venue and organizer phone numbers into callable links
// Link the Venue Phone Number
add_filter( 'tribe_get_phone', 'filter_link_the_phone' );
function filter_link_the_phone( $phone ) {
return '<a href="tel:' . $phone . '">' . $phone . '</a>';
}
// Link the Organizer Phone Number
add_filter( 'tribe_get_organizer_phone', 'filter_link_the_organizer_phone' );
function filter_link_the_organizer_phone( $phone ) {
return '<a href="tel:' . $phone . '">' . $phone . '</a>';
}
@shoreline-chrism
Copy link

This ends up escaping the HTML for the link tags since the functions tribe_get_phone and tribe_get_organizer_phone escape the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment