Add to Calendar – Google, iCal, Outlook 365
-
The events calendar “Add to Calendar” drop down is correctly offering the date/title/information for the individual events – BUT, due to page builder, a lot of shortcodes are getting pulled into the description on the ical and google calendar events.
I found a way to filter and customize the Google calendar link, but I see no way to apply a similar customization to the ical / outlook 365 links. Is there are a way to filter/customize the ical and outlook 365 add to calendar links?
Here is a function / filter I’ve added to pull in the excerpt instead of the full content, and remove any paragraph tags that get pulled into the event description.
function custom_tec_gcal_link_parameters( $gcal_params, $event ) {
// Get the event excerpt using tribe_events_get_the_excerpt
$event_excerpt = tribe_events_get_the_excerpt( $event->ID, null );
// Remove the <p> tags if present
$event_excerpt = preg_replace('/^<p>|<\/p>$/', '', $event_excerpt);
// Update the 'details' parameter in the Google Calendar link parameters
$gcal_params['details'] = $event_excerpt;
return $gcal_params;
}
add_filter( 'tec_views_v2_single_event_gcal_link_parameters', 'custom_tec_gcal_link_parameters', 10, 2 );The page I need help with: [log in to see the link]
- The topic ‘Add to Calendar – Google, iCal, Outlook 365’ is closed to new replies.