Add iCalendar "Conference" property to generated ics file. Event Espresso 4
<?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