Last active
August 29, 2015 14:06
-
-
Save jesseeproductions/ed1257c1580fddac7700 to your computer and use it in GitHub Desktop.
Filter iCAL Description for Events Calendar 3.7
This file contains 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
/* | |
* 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