Last active
June 8, 2022 21:07
-
-
Save afragen/2831526 to your computer and use it in GitHub Desktop.
Modify Event Calendar iCal feed properties for Outlook
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 the following to your theme's functions.php | |
add_filter( 'tribe_ical_properties', 'tribe_ical_outlook_modify', 10, 2 ); | |
function tribe_ical_outlook_modify( $content ) { | |
$properties = preg_split ( '/$\R?^/m', $content ); | |
$searchValue = "X-WR-CALNAME"; | |
$fl_array = preg_grep('/^' . "$searchValue" . '.*/', $properties); | |
$key = array_values($fl_array); | |
$keynum = key($fl_array); | |
unset($properties[$keynum]); | |
$content = implode( "\n", $properties ); | |
return $content; | |
} | |
?> |
@afragen Really? Interesting. Do you have a link or more info? I didn't come across it when researching this need. I've got things working now with my code, but definitely want to know what other options are out there.
@afragen Thanks for sharing. I totally missed that, as we weren't thinking about Outlook but instead wanting to avoid that for Apple devices. I did see the additions to TEC, but we're hoping to make the change globally, so the custom code was (I think) still required for us. Appreciate the pointers!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is actually a plugin on dot org and has been incorporated into the latest version of The Events Calendar.