Created
February 13, 2014 21:42
-
-
Save codescribblr/8984476 to your computer and use it in GitHub Desktop.
Add attachments to Events Calendar Pro (2.1) iCal feed
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
| 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