From ad18deaca91736f8a08464b478d596a716f1d952 Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 23 May 2025 09:56:02 -0500 Subject: [PATCH] Add URL field to iCal (.ics) feed output for sp_event posts Include a URL: field in each VEVENT entry that points to the permalink of the event (get_permalink($event->ID)). This is compliant with the iCalendar specification (RFC 5545, Section 3.8.4.6) and is supported by most major calendar apps. The addition allows users to quickly access the full event details from their calendar. addresses #478 --- feeds/ical.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feeds/ical.php b/feeds/ical.php index 92a8c6a7..513bd21d 100644 --- a/feeds/ical.php +++ b/feeds/ical.php @@ -161,7 +161,8 @@ function( $m ) { "DTSTAMP:19700101T000000\r\n" . 'DTSTART:' . mysql2date( $date_format, $event->post_date ) . "\r\n" . 'DTEND:' . $end->format( $date_format ) . "\r\n" . - 'LAST-MODIFIED:' . mysql2date( $date_format, $event->post_modified_gmt ) . "\r\n"; + 'LAST-MODIFIED:' . mysql2date( $date_format, $event->post_modified_gmt ) . "\r\n". + 'URL:' . esc_url(get_permalink($event->ID)) . "\r\n"; if ( $description ) { $output .= 'DESCRIPTION:' . $description . "\r\n";