Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
Last active August 29, 2015 14:06
Show Gist options
  • Save jesseeproductions/ed1257c1580fddac7700 to your computer and use it in GitHub Desktop.
Save jesseeproductions/ed1257c1580fddac7700 to your computer and use it in GitHub Desktop.
Filter iCAL Description for Events Calendar 3.7
/*
* Filter ical Description for Events Calendar 3.7
* Removes tags and most shortcodes for single event only
*
*/
add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2);
function filter_ical_description($item, $eventPost) {
$description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) );
$description = preg_replace ("/\[(\S+)\]/e", "", $description);
$item[7] = 'DESCRIPTION:' . str_replace( ',','\,', $description );
return $item;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment