Created
May 9, 2012 23:59
-
-
Save afragen/2649910 to your computer and use it in GitHub Desktop.
Modify the DESCRIPTION of generated ical feed
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
<?php | |
//Add to your theme's functions.php | |
add_filter( 'tribe_ical_feed_item', 'tribe_ical_modify_event', 10, 2 ); | |
function tribe_ical_modify_event( $item, $eventPost ) { | |
$searchValue = "DESCRIPTION"; | |
$fl_array = preg_grep('/^' . "$searchValue" . '.*/', $item); | |
$key = array_values($fl_array); | |
$keynum = key($fl_array); | |
$mod = substr($key[0], 0, 1000); | |
unset($item[$keynum]); | |
$item[] = $mod; | |
return $item; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment