Skip to content

Instantly share code, notes, and snippets.

@afragen
Last active June 8, 2022 21:07
Show Gist options
  • Save afragen/2831526 to your computer and use it in GitHub Desktop.
Save afragen/2831526 to your computer and use it in GitHub Desktop.
Modify Event Calendar iCal feed properties for Outlook
<?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;
}
?>
@mrwweb
Copy link

mrwweb commented Jun 8, 2022

@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