Created
November 4, 2020 21:24
-
-
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.
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 | |
/** | |
* 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?