Skip to content

Instantly share code, notes, and snippets.

@pixeldevsio
Last active January 30, 2020 15:27
Show Gist options
  • Save pixeldevsio/69cd9e7cc4da5723a5406fd2e6a94fce to your computer and use it in GitHub Desktop.
Save pixeldevsio/69cd9e7cc4da5723a5406fd2e6a94fce to your computer and use it in GitHub Desktop.
Modify the iCal event for Tribe Events Calendar (includes multi-day events)
<?php
/**
* Change iCal description and title
*/
function filter_ical_item( $item, $eventPost ) {
// Get the end time
$endTime = tribe_get_end_date($eventPost->ID, false, 'Hi');
// Make sure it's a multi-day event
if(tribe_event_is_multiday()){
// if the time is 11:59pm
if($endTime == '2359'){
// Summary is the title
$item[] = 'SUMMARY: ' . get_the_title() . ' - Ending time not correct ' . $endTime;
}
}
// change the description to the link only
$item[] = 'DESCRIPTION:' . tribe_get_event_link();
return $item;
}
add_filter( 'tribe_ical_feed_item', 'filter_ical_item', 10, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment