gpb_google_calendar_get_events_params
Description
Filter the Google Calendar API request params used when fetching events.
Usage
Applied globally
add_filter( 'gpb_google_calendar_get_events_params', 'my_custom_function' );Parameters
$params
array
Query params passed to the Google Calendar API client.
timeMin
string
ISO 8601 start datetime for the query window.
timeMax
string
ISO 8601 end datetime for the query window.
singleEvents
bool
Whether recurring events should be expanded into instances.
orderBy
string
Sort order applied to the returned events.
eventTypes
string[]
Google event types to include in the response.
$google_account_id
string
The Google account ID.
$google_calendar_id
string
The Google Calendar ID.
$now
CarbonCarbonImmutable
Current time used for the query window start.
$end
CarbonCarbonImmutable
End of the query window.
Examples
Include out-of-office events when syncing Google Calendar availability.
add_filter( 'gpb_google_calendar_get_events_params', function( $params, $google_account_id, $google_calendar_id, $now, $end ) {
$params['eventTypes'] = [ 'default', 'outOfOffice' ];
return $params;
}, 10, 5 );Since
1.0-beta-2.2Hook added.