gpb_ics_event
Description
Filter the ICS event data before it’s added to the calendar.
Usage
Applied globally
add_filter( 'gpb_ics_event', 'my_custom_function' );
Parameters
$event
array
The ICS event data.
SUMMARY
string
Event title
DESCRIPTION
string
Event description/details
UID
string
Unique event identifier
DTSTART
DateTime
Event start time (UTC)
DTEND
DateTime
Event end time (UTC)
DTSTAMP
DateTime
Last modification time (UTC)
$booking
Booking
The booking object the event is based on.
Examples
Update the description with entry data.
add_filter( 'gpb_ics_event', function( $event, $booking ) {
$entry = $booking->get_entry();
if ( $entry ) {
$form = GFAPI::get_form( $entry['form_id'] );
if ( $form ) {
$event['DESCRIPTION'] .= GFCommon::replace_variables( '{all_fields}', $form, $entry, false, false, false, 'text' );
}
}
return $event;
}, 10, 2 );
Since
1.0-alpha-3.4
Hook added.