Skip to content

Instantly share code, notes, and snippets.

@codescribblr
Created February 13, 2014 21:42
Show Gist options
  • Select an option

  • Save codescribblr/8984476 to your computer and use it in GitHub Desktop.

Select an option

Save codescribblr/8984476 to your computer and use it in GitHub Desktop.
Add attachments to Events Calendar Pro (2.1) iCal feed
add_filter('tribe_ical_feed_item','tribe_add_attachment_to_ical', 10, 2);
function tribe_add_attachment_to_ical($item, $event){
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $event->ID
);
$size = 'full';
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$item[] = "ATTACH:".wp_get_attachment_image_src($attachment->ID, $size);
}
}
return $item;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment