Skip to content

Instantly share code, notes, and snippets.

@elimn
Created April 24, 2017 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elimn/dd7de019f478bd151ca14cafe7d284f1 to your computer and use it in GitHub Desktop.
Save elimn/dd7de019f478bd151ca14cafe7d284f1 to your computer and use it in GitHub Desktop.
MT | ET | Add a + Google Calendar link to each ticket in the tickets email
<?php
/**
* Adds a + Google Calendar link to each ticket in the tickets email
*/
function tribe_add_gcal_to_email( $event ) {
printf(
'<a class="tribe-events-gcal tribe-events-button" href="%1$s" title="%2$s">%3$s</a>',
Tribe__Events__Main::instance()->esc_gcal_url( tribe_get_gcal_link( $event ) ),
esc_attr__( 'Add to Google Calendar', 'the-events-calendar' ),
esc_html__( 'Add to Google Calendar', 'the-events-calendar' )
);
}
add_action ( 'tribe_tickets_ticket_email_ticket_bottom', 'tribe_add_gcal_to_email', 101, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment