Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function filter_ical_description($item) {
- global $post;
- $description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) );
- // add fields to iCal output
- $item = array();
- $item[] = "DTSTART;VALUE=$type:" . $startDate;
- $item[] = "DTEND;VALUE=$type:" . $endDate;
- $item[] = 'DTSTAMP:' . date( 'Ymd\THis', time() );
- $item[] = 'CREATED:' . str_replace( array( '-', ' ', ':' ) , array( '', 'T', '' ) , $eventPost->post_date );
- $item[] = 'LAST-MODIFIED:' . str_replace( array( '-', ' ', ':' ) , array( '', 'T', '' ) , $eventPost->post_modified );
- $item[] = 'UID:' . $eventPost->ID . '-' . strtotime( $startDate ).'-'.strtotime( $endDate ) . '@' . $blogHome;
- $item[] = 'SUMMARY:' . $eventPost->post_title;
- $item[] = 'DESCRIPTION:' . str_replace( ',','\,', $description );
- $item[] = 'LOCATION:' . html_entity_decode( $tribeEvents->fullAddressString( $eventPost->ID ), ENT_QUOTES );
- $item[] = 'URL:' . get_permalink( $eventPost->ID );
- $item = apply_filters( 'tribe_ical_feed_item', $item, $eventPost );
- return $item;
- }
- add_filter('tribe_ical_feed_item()','filter_ical_description');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement