Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
Created November 4, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrasguseo/fad4184c3f6fc22b6832bd5553ec849a to your computer and use it in GitHub Desktop.
Save andrasguseo/fad4184c3f6fc22b6832bd5553ec849a to your computer and use it in GitHub Desktop.
The Events Calendar : Change the post content to the excerpt in the iCal export.
<?php
/**
* Description: This snippet will change the post conetent to the post excerpt
* in the iCal export feed.
* Note, if the excerpt is empty, it will also be empty in the export.
*
* Usage: Copy the snippet into your child theme's functions.php file.
*
* Plugins: The Events Calendar
* Author: Andras Guseo
* Last updated: November 4, 2020
*/
add_filter( 'tribe_ical_feed_item', 'tribe_change_content_to_excerpt_in_ical', 10, 2 );
function tribe_change_content_to_excerpt_in_ical( $item, $event_post ) {
$excerpt = $event_post->post_excerpt;
$item['DESCRIPTION'] = "DESCRIPTION:" . $excerpt;
return $item;
}
@bgunninghb
Copy link

Hi - I can't get this to work? It still just pulls the main content and not the excerpt. Is this still working for you?

@andrasguseo
Copy link
Author

Hi @bgunninghb

I just tested this and it still works, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment