Forked from andrasguseo/add-export-links-to-email.php
Last active
July 30, 2021 20:56
-
-
Save Camwyn/07b5b5c602858dec408a079a85ef9612 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 (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 yet, 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/) | |
*/ | |
add_action( 'tribe_tickets_ticket_email_ticket_bottom', 'add_export_buttons_to_email' ); | |
function add_export_buttons_to_email( array $ticket ) { | |
/** @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
I don't think that
global $post
is necessary here and it's dangerous to overwrite it...Needs testing.