Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
Created February 8, 2018 00:56
Show Gist options
  • Save GeoffEW/4ccef04ab841c0be2e1083b0733057cd to your computer and use it in GitHub Desktop.
Save GeoffEW/4ccef04ab841c0be2e1083b0733057cd to your computer and use it in GitHub Desktop.
* Convert organizer emails into live "mailto:" links that users can click on.
<?php
/**
* Convert organizer emails into live "mailto:" links that users can click on.
*
* @param $email
* @return string
*/
function organizer_live_email_link( $email ) {
if ( ! is_email( $email ) || ! is_singular( Tribe__Events__Main::POSTTYPE ) ) return $email;
return '<a href="mailto:' . esc_attr( $email ) . '">' . esc_html( $email ) . '</a>';
}
add_filter( 'tribe_get_organizer_email', 'organizer_live_email_link' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment