Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Last active December 15, 2015 12:09
Show Gist options
  • Select an option

  • Save jo-snips/5258402 to your computer and use it in GitHub Desktop.

Select an option

Save jo-snips/5258402 to your computer and use it in GitHub Desktop.
The Events Calendar - Filter iCal Description
<?php
function filter_ical_description($item, $eventPost) {
$description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) );
$description .= '<a href="http://www.mysite.com">Back to site</a>';
$item[] = 'X-ALT-DESC;FMTTYPE=text/html:' . str_replace( ',','\,', $description );
return $item;
}
add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment