Limited time discount Book Smarter This Christmas
Up to 50%Off

How can I use WordPress hooks for Google Calendar in Amelia

Amelia provides a set of hooks related to the Google Calendar integration, allowing you to modify authentication URLs, control how calendars are connected or disconnected, and customize how events are created, updated, patched, or deleted in Google Calendar. These hooks help you extend Amelia safely without adjusting core plugin files.

Info Note

Hooks require programming knowledge, and support is limited to general guidance.

Get authentication URL

How do I modify the Google Calendar authentication URL?

amelia_get_google_calendar_auth_url_filter

Type: filter

Use this filter to modify the authentication URL for an employee connecting their Google Calendar.

				
					function example($authUrl, $employeeId)
{
    return $authUrl;
}

add_filter('amelia_get_google_calendar_auth_url_filter', 'example', 10, 2);
				
			

How do I run code before the authentication URL is returned?

amelia_get_google_calendar_auth_url

Type: action

Runs before the authentication URL for an employee connecting their Google Calendar is returned.

				
					function example($authUrl, $employeeId)
{
    // do action
}

add_action('amelia_get_google_calendar_auth_url', 'example', 10, 2);
				
			

Google Calendar added

How do I modify Google Calendar data before it is saved?

amelia_before_google_calendar_added_filter

Type: filter

Use this filter to modify the Google Calendar object before it is saved to the database after successful authentication.

				
					function example($accessToken, $employeeId)
{
    return $accessToken;
}

add_filter('amelia_before_google_calendar_added_filter', 'example', 10, 2);
				
			

How do I run code before Google Calendar is saved?

amelia_before_google_calendar_added

Type: action

Runs before Google Calendar data is saved to the database after successful authentication.

				
					function example($googleCalendar, $employeeId)
{
    // do action
}

add_action('amelia_before_google_calendar_added', 'example', 10, 2);
				
			

How do I run code after Google Calendar is saved?

amelia_after_google_calendar_added

Type: action

Runs after Google Calendar data is saved to the database after successful authentication.

				
					function example($googleCalendar, $employeeId)
{
    // do action
}

add_action('amelia_after_google_calendar_added', 'example', 10, 2);
				
			

Google Calendar deleted

How do I run code before Google Calendar is disconnected?

amelia_before_google_calendar_deleted

Type: action

Runs before Google Calendar data is deleted from the database when an employee disconnects their account.

				
					function example($googleCalendar, $employeeId)
{
    // do action
}

add_action('amelia_before_google_calendar_deleted', 'example', 10, 2);
				
			

How do I run code after Google Calendar is disconnected?

amelia_after_google_calendar_deleted

Type: action

Runs after Google Calendar data is deleted from the database when an employee disconnects their account.

				
					function example($googleCalendar, $employeeId)
{
    // do action
}

add_action('amelia_after_google_calendar_deleted', 'example', 10, 2);
				
			

Event added

How do I modify event data before it is added to Google Calendar?

amelia_before_google_calendar_event_added_filter

Type: filter

Use this filter to modify event data before it is inserted into Google Calendar.

				
					function example($event, $appointment, $provider)
{
    return $event;
}

add_filter('amelia_before_google_calendar_event_added_filter', 'example', 10, 3);
				
			

How do I run code before an event is added to Google Calendar?

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

amelia_before_google_calendar_event_added

Type: action

Runs before an event is inserted into Google Calendar.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_before_google_calendar_event_added', 'example', 10, 3);
				
			

How do I run code after an event is added to Google Calendar?

amelia_after_google_calendar_event_added

Type: action

Runs after an event is inserted into Google Calendar.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_after_google_calendar_event_added', 'example', 10, 3);
				
			

Event updated

How do I modify event data before it is updated in Google Calendar?

amelia_before_google_calendar_event_updated_filter

Type: filter

Use this filter to modify event data before it is updated in Google Calendar.

				
					function example($event, $appointment, $provider)
{
    return $event;
}

add_filter('amelia_before_google_calendar_event_updated_filter', 'example', 10, 3);
				
			

How do I run code before an event is updated in Google Calendar?

amelia_before_google_calendar_event_updated

Type: action

Runs before an event is updated in Google Calendar.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_before_google_calendar_event_updated', 'example', 10, 3);
				
			

How do I run code after an event is updated in Google Calendar?

amelia_after_google_calendar_event_updated

Type: action

Runs after an event is updated in Google Calendar.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_after_google_calendar_event_updated', 'example', 10, 3);
				
			

Event patched

How do I modify event data before it is patched in Google Calendar?

amelia_before_google_calendar_event_patched_filter

Type: filter

Use this filter to modify event data before it is patched in Google Calendar when bookings are added or canceled.

				
					function example($event, $appointment, $provider)
{
    return $event;
}

add_filter('amelia_before_google_calendar_event_patched_filter', 'example', 10, 3);
				
			

How do I run code before an event is patched in Google Calendar?

amelia_before_google_calendar_event_patched

Type: action

Runs before an event is patched in Google Calendar when bookings are added or canceled.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_before_google_calendar_event_patched', 'example', 10, 3);
				
			

How do I run code after an event is patched in Google Calendar?

amelia_after_google_calendar_event_patched

Type: action

Runs after an event is patched in Google Calendar when bookings are added or canceled.

				
					function example($event, $appointment, $provider)
{
    // do action
}

add_action('amelia_after_google_calendar_event_patched', 'example', 10, 3);
				
			

Event deleted

How do I run code before an event is deleted from Google Calendar?

amelia_before_google_calendar_event_deleted

Type: action

Runs before an event is deleted from Google Calendar.

				
					function example($appointment, $provider)
{
    // do action
}

add_action('amelia_before_google_calendar_event_deleted', 'example', 10, 2);
				
			

How do I run code after an event is deleted from Google Calendar?

amelia_after_google_calendar_event_deleted

Type: action

Runs after an event is deleted from Google Calendar.

				
					function example($appointment, $provider)
{
    // do action
}

add_action('amelia_after_google_calendar_event_deleted', 'example', 10, 2);