-
-
Save theeventscalendar/a85ec4d1f55ab872c250 to your computer and use it in GitHub Desktop.
Makes the Organizer email a mailto link on single event pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 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