Last active
January 30, 2020 15:27
-
-
Save pixeldevsio/69cd9e7cc4da5723a5406fd2e6a94fce to your computer and use it in GitHub Desktop.
Modify the iCal event for Tribe Events Calendar (includes multi-day events)
This file contains hidden or 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 | |
/** | |
* 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