Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Last active April 20, 2017 22:16
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 cliffordp/f6b4669f2d1059f288d0583cc50a2944 to your computer and use it in GitHub Desktop.
Save cliffordp/f6b4669f2d1059f288d0583cc50a2944 to your computer and use it in GitHub Desktop.
Add single event iCal/.ics link to bottom of tickets email
<?php
/**
* Add single event iCal/.ics link to bottom of tickets email
*
* From https://gist.github.com/cliffordp/f6b4669f2d1059f288d0583cc50a2944
* Alternative if you want both Google Calendar link and iCal/.ics file link: https://gist.github.com/cliffordp/f9dfbb225d79fddd7154fa33ba25166a
**/
add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'cliff_ical_link_on_ticket_emails', 50 );
function cliff_ical_link_on_ticket_emails() {
if( ! function_exists( 'tribe_get_single_ical_link' ) ) {
return;
}
echo '<a class="tribe-events-ical tribe-events-button" href="' . esc_url( tribe_get_single_ical_link() ) . '" title="' . esc_attr__( 'Download .ics file', 'the-events-calendar' ) . '" >+ ' . esc_html__( 'iCal Export', 'the-events-calendar' ) . '</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment