Last active
July 30, 2021 20:54
-
-
Save andrasguseo/038c4534762aa65a951bb6eb1e8b6ebf to your computer and use it in GitHub Desktop.
Add the 'Export to Google Calendar / iCal' links to the bottom of the ticket email for Event Tickets
This file contains 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
<?php | |
/** | |
* Description: Adds the 'Export to Google Calendar / iCal' links to the bottom of the ticket email | |
* | |
* Instructions: Copy the snippet into your theme's (preferably child theme's) functions.php file. | |
* Note: Design can be adjusted with css in wp-content/plugins/event-tickets/src/views/tickets/email.php | |
* or better, create a template override for that. | |
* Info on template overrides can be found in our Themer's Guide | |
* https://theeventscalendar.com/knowledgebase/themers-guide/ | |
* | |
* Plugins: Event Tickets (https://wordpress.org/plugins/event-tickets/) | |
* Author: Luca Tumedei | |
* Last Updated: January 19, 2018 | |
*/ | |
add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'add_export_buttons_to_email' ); | |
function add_export_buttons_to_email( array $ticket ) { | |
global $post; | |
$post = get_post( $ticket['event_id'] ); | |
/** @var Tribe__Events__iCal $ical */ | |
$ical = tribe( 'tec.iCal' ); | |
$ical->single_event_links(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment