Created
November 4, 2020 22:22
-
-
Save andrasguseo/50313b388b51087d582694c029dcf2b4 to your computer and use it in GitHub Desktop.
The Events Calendar : Strip shortcodes from the post content 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 try to strip the shortcodes from the post content | |
* in the iCal export feed. | |
* | |
* 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 ) { | |
$content = preg_replace( '/(\[.*?\])/', '', $event_post->post_content ); | |
$item['DESCRIPTION'] = "DESCRIPTION:" . $content; | |
return $item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment