Last active
March 28, 2020 15:05
-
-
Save joshfeck/d247c39f84d48db165e10113e8f39925 to your computer and use it in GitHub Desktop.
Add iCalendar "Conference" property to generated ics file. Event Espresso 4
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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( | |
'FHEE__EED_Ical__download_ics_file_ics_data', | |
'my_custom_ics_virtual_location', | |
10, | |
2 | |
); | |
function my_custom_ics_virtual_location( | |
$ics_data, | |
$datetime | |
) { | |
$event = $datetime->event(); | |
if($event instanceof EE_Event) { | |
$venue = $event->venues(array('limit' => 1)); | |
if (is_array($venue) && ! empty($venue)) { | |
$venue = array_shift($venue); | |
if ($venue instanceof EE_Venue) { | |
if (!empty($venue->virtual_url())) { | |
$ics_data['CONFERENCE;VALUE=URI'] = $venue->virtual_url(); | |
} | |
} | |
} | |
} | |
return $ics_data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment