since v.0.8.0

Add Custom iCal & gCal Buttons / Links to your site

Use the xdgp_calendar_ical_link() and xdgp_calendar_gcal_link() functions to generate URLs  for iCal and gCal events respectively.

These functions take a single performance object as an argument.

foreach($post->performances as$performance) {
    // ... Display Performance Information
        echo'<a class="btn btn-primary" href="'.xdgp_calendar_ical_link($performance).'">Add to iCal</a>';
        echo'<a class="btn btn-primary" href="'.xdgp_calendar_gcal_link($performance).'">Add to Google Calendar</a>';
    // ...