Skip to content

Calendars Actions ​

4 action hooks on this page, across 6 call sites.

HookFiresCall Sites
fluent_event/calendar/before_deletedBefore a calendar is deleted, while its events still exist.1
fluent_event/calendar/createdAfter a new calendar is saved.2
fluent_event/calendar/deletedAfter a calendar and all of its events are deleted.1
fluent_event/calendar/updatedAfter a calendar is saved with new values.2

fluent_event/calendar/before_deleted ​

  • Type: action
  • Call sites: 1
  • When it fires: Before a calendar is deleted, while its events still exist.

CleanupHandler::cleanCalendar() listens here and deletes every event in the calendar, one at a time, so fluent_event/event/before_deleted and fluent_event/event/deleted fire once per event.

Parameters ​

#NameTypeDescription
1$calendarCalendarThe calendar about to be deleted.

Call Sites ​

SourceContextArguments
fluent-event/app/Http/Controllers/CalendarController.php:123CalendarController::deleteCalendar()$calendar

Listeners Inside FluentEvent ​

FluentEvent itself listens to this hook. Use a priority below or above these to run before or after them.

PriorityHandlerSource
10[$this, 'cleanCalendar']fluent-event/app/Hooks/Handlers/CleanupHandlers/CleanupHandler.php:16

Example ​

php
add_action('fluent_event/calendar/before_deleted', function ($calendar) {
    // Your code here.
}, 10, 1);

fluent_event/calendar/created ​

  • Type: action
  • Call sites: 2
  • When it fires: After a new calendar is saved.

Fires from the admin Create Calendar endpoint, and from the FluentCommunity bridge when the first event posted in a space (or outside any space) creates that space's calendar.

Parameters ​

#NameTypeDescription
1$calendarCalendarThe saved calendar. created_by is the current user.

Call Sites ​

SourceContextArguments
fluent-event/app/Http/Controllers/CalendarController.php:89CalendarController::createCalendar()$calendar
fluent-event/Modules/FluentCommunity/FeedHandler.php:448FeedHandler::calendarFor()$calendar

Example ​

php
add_action('fluent_event/calendar/created', function ($calendar) {
    // Your code here.
}, 10, 1);

fluent_event/calendar/deleted ​

  • Type: action
  • Call sites: 1
  • When it fires: After a calendar and all of its events are deleted.

Parameters ​

#NameTypeDescription
1$calendarCalendarThe deleted calendar, with its last values.

Call Sites ​

SourceContextArguments
fluent-event/app/Http/Controllers/CalendarController.php:127CalendarController::deleteCalendar()$calendar

Example ​

php
add_action('fluent_event/calendar/deleted', function ($calendar) {
    // Your code here.
}, 10, 1);

fluent_event/calendar/updated ​

  • Type: action
  • Call sites: 2
  • When it fires: After a calendar is saved with new values.

Fires from the admin Update Calendar endpoint, and from the FluentCommunity bridge when a space is deleted: the space calendar becomes a draft and loses its space link.

Parameters ​

#NameTypeDescription
1$calendarCalendarThe saved calendar.

Call Sites ​

SourceContextArguments
fluent-event/app/Http/Controllers/CalendarController.php:111CalendarController::updateCalendar()$calendar
fluent-event/Modules/FluentCommunity/SpaceHandler.php:85SpaceHandler::parkCalendar()$calendar

Example ​

php
add_action('fluent_event/calendar/updated', function ($calendar) {
    // Your code here.
}, 10, 1);

FluentEvent developer documentation