Add attachments to Events Calendar Pro (2.1) iCal feed


/ Published in: PHP
Save to your folder(s)

Requires filter added in ECP 2.1


Copy this code and paste it in your HTML
  1. add_filter('tribe_ical_feed_item','tribe_add_attachment_to_ical', 10, 2);
  2.  
  3. function tribe_add_attachment_to_ical($item, $event){
  4.  
  5. $args = array(
  6. 'post_type' => 'attachment',
  7. 'numberposts' => -1,
  8. 'post_status' => null,
  9. 'post_parent' => $event->ID
  10. );
  11.  
  12. $size = 'full';
  13.  
  14. $attachments = get_posts($args);
  15. if ($attachments) {
  16. foreach ($attachments as $attachment) {
  17. $item[] = "ATTACH:".wp_get_attachment_image_src($attachment->ID, $size);
  18.  
  19. }
  20. }
  21.  
  22. return $item;
  23. }

URL: http://tri.be/support/forums/topic/ical-export-does-not-include-attached-images/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.