Pro module7 abilities

The Events Calendar ability reference

Reference for the GoBuildWP Pro 1.12.4 source. Installed schemas and policy remain authoritative.

The Events Calendar ability reference on this page covers how an agent finds, reads, creates and edits events through The Events Calendar's own event API, moves them to the WordPress trash or deletes them, and how it reads ticket and RSVP inventory for an event when Event Tickets is installed.

Read-only, write and destructive groups describe the source annotations. They do not establish a minimum safety profile, human approval or undo support. Those controls are separate: check the installed ability, the connected user and the active site policy before calling it. A read can still return sensitive data. These pages are not evidence that every operation passed an end-to-end runtime test.

What The Events Calendar needs before these load

The Events Calendar 6.6.0 or newer must be active; the gate looks for Tribe__Events__Main, the tribe_get_events and tribe_get_event functions, and a version at or above WPPILOT_PRO_EVENTS_CALENDAR_MIN_VERSION. Event Tickets is an optional companion from 5.8.0; without it, events-calendar-list-event-tickets returns events_calendar_tickets_unavailable. Every call goes through GoBuildWP's standard permission check (abilities switched on and manage_options). events-calendar-check-setup also reports whether the current user holds edit_tribe_events, publish_tribe_events and delete_tribe_events.

Minimum (base)
6.6.0 WPPILOT_PRO_EVENTS_CALENDAR_MIN_VERSION
Minimum (companion)
5.8.0 WPPILOT_PRO_EVENT_TICKETS_MIN_VERSION
The Events Calendar editions
free, pro
Agent skills shipped
events-calendar-integration

Dates and timezones on an event

Writes go through tribe_create_event(), tribe_update_event() and tribe_delete_event() rather than raw post meta, so The Events Calendar applies its own handling. Start and end are sent as Y-m-d H:i:s in the event's timezone, which the timezone field sets; a different format returns events_calendar_invalid_date and an end before the start returns events_calendar_invalid_date_range. Changing one end of an event keeps the other as stored in _EventStartDate or _EventEndDate.

Reads return start and end as ISO 8601 with their offset, the _EventTimezone value, the all-day flag, venue_id, organizer_ids, cost, website and tribe_events_cat categories. A write accepts one venue and one organiser by id. The listing defaults to published events, filters by search text and a Y-m-d date window, and pages at up to 100 per request.

Drafts, trash and confirmation

A new event is saved as a draft unless another status is passed. Editing and deleting are annotated as destructive, so GoBuildWP's confirmation gate refuses them with wppilot_confirmation_required unless the call carries confirm: true; on a site whose confirmation mode is set to human, a person has to approve the call instead. Deleting moves the event to the trash unless force=true is sent, and the result is checked afterwards (events_calendar_delete_verification_failed if the event is still there). Trashed events are treated as not found by the other calls.

Tickets stay read-only. Each row gives name, description, price, capacity, stock, the sale window and the provider class; no attendee data is returned and nothing about a sale can be changed.

Representative call sequence

This sequence describes the documented calls and checks to perform. It is not a recorded result from an installed WordPress site. Inspect returned errors and partial results, then verify the saved values and affected output before proceeding.

Move Saturday's workshop an hour later and check how many seats are left.

  1. 01 wppilot/events-calendar-list-events Searches upcoming published events for the workshop and returns its id and current start and end.
  2. 02 wppilot/events-calendar-get-event Reads the full event, including content and timezone, before anything changes.
  3. 03 wppilot/events-calendar-edit-event Sends the new start and end with confirm: true and returns the stored event as The Events Calendar saved it.
  4. 04 wppilot/events-calendar-list-event-tickets Reports each ticket's capacity and remaining stock for the event.

The Events Calendar in practice

How an event time travels from the request into The Events Calendar

The abilities accept start and end as Y-m-d H:i:s, but The Events Calendar's own API does not read that format. It parses the date half with the site's datepicker format setting (n/j/Y out of the box) and only replaces the stored schedule when it is given a date and a time for both ends. GoBuildWP therefore splits each value into EventStartDate or EventEndDate, written in the site's datepicker format, plus EventStartTime or EventEndTime in 24-hour form. The source records why: the raw format was once stamped with the time of the request on a new event and ignored on an edit, while both calls reported success.

Validation is strict. A value PHP would quietly roll over, such as 31 April, is rejected with events_calendar_invalid_date instead of becoming 1 May. An edit that sends neither start nor end leaves the schedule untouched. The listing's start_date and end_date filters are plain Y-m-d dates checked before the query runs. Reads return the stored times as ISO 8601 with an offset, so after any schedule change compare those strings, offset included, with what was intended rather than trusting the success flag.

Event fields GoBuildWP can set, and the ones it cannot clear

Only the fields sent are mapped into The Events Calendar's update, so a partial edit does not blank the rest. The limits and conversions below come from the module's input schema and its mapping code.

  • title (1 to 500 characters), excerpt (up to 10,000) and status are sanitised as plain text; content (up to 200,000) passes through wp_kses_post, so scripts and disallowed markup are stripped.
  • status on a write is draft, publish, pending or private; the listing can additionally filter by future.
  • website goes through esc_url_raw, and cost is stored as text of up to 100 characters.
  • venue_id and organizer_id attach one venue and one organiser when they are positive. Neither accepts zero, so an existing venue or organiser cannot be removed through GoBuildWP; do that in the event editor.
  • category_ids (up to 100) is sent as the event's tribe_events_cat list, so include every category the event should keep.
  • There is no recurrence input. Recurring series from Events Calendar Pro are not exposed, and an edit should never be described as applying to a whole series.
  • An edit needs event_id plus at least one other field; when nothing usable is left after mapping it returns events_calendar_no_changes.

Undo for events: creates roll back, edits and deletes do not

The change ledger treats the event writes differently. A create is recorded against the tribe_events post type, so wppilot/rollback-change can remove the event it made; the ledger map notes that the event is trashed through The Events Calendar's own hooks. Edits and deletes are recorded as irreversible, because The Events Calendar 6 mirrors dates into its tec_events and tec_occurrences tables and a plain post restore is not guaranteed to resync them (see change ledger and rollback).

The practical undo for an edit is a before-image: the full wppilot/events-calendar-get-event result taken before the change, whose fields can be sent back through wppilot/events-calendar-edit-event, except that a venue or organiser added by the edit cannot be detached that way. A delete without force uses WordPress's own trash on purpose, because tribe_delete_event() would have removed the event outright; a forced delete has no way back through GoBuildWP.

Event Tickets: active is not the same as available

wppilot/events-calendar-check-setup reports tickets.plugin_active and tickets.available separately. The first only says Event Tickets is loaded; the second also requires version 5.8.0 or newer and its Tribe__Tickets__Tickets class. Only available: true means wppilot/events-calendar-list-event-tickets will answer; otherwise it returns events_calendar_tickets_unavailable even with the plugin switched on, and the fix is an Event Tickets update.

Each ticket row gives the id, name, description, price as text, capacity and stock (null when Event Tickets holds no value), the sale start and end exactly as stored, and the provider class name. The ticket call checks the event first, so a trashed or wrong-type id is refused with events_calendar_event_not_found before Event Tickets is asked anything.

Permissions, profiles and event error codes

Every event call relies on GoBuildWP's own permission check alone. The edit_tribe_events, publish_tribe_events and delete_tribe_events values in check-setup are reported for information; the abilities do not test them. Under the Read Only safety profile the reads remain and every write disappears. Under Production Safe a create runs without confirmation and lands as a draft unless status says otherwise, while edits and deletes need confirm: true or a person's approval. The edit's own instructions single out publishing and date changes as the edits to put to the user explicitly.

  • events_calendar_event_not_found: the id is not a tribe_events post, or it is trashed or an auto-draft; list again with the right status.
  • events_calendar_create_failed or events_calendar_update_failed: tribe_create_event() or tribe_update_event() returned no id; read the event before retrying so a change is not applied twice.
  • events_calendar_delete_failed: the trash or permanent delete did not happen; check the Events list in wp-admin.
  • events_calendar_query_failed: tribe_get_events() did not return a query object, which points at The Events Calendar itself rather than at the input.

Worked request: publishing a workshop at a named venue

Request: add the pottery workshop on 18 October from 10:00 to 13:00 at the Market Hall and publish it. The agent runs wppilot/events-calendar-check-setup, then needs the venue id; the module has no venue lookup, so the id comes from the user, from wp-admin, or from wppilot/events-calendar-get-event on an earlier event at that venue. It creates a draft with wppilot/events-calendar-create-event, shows the stored event, and publishes with wppilot/events-calendar-edit-event, status publish and confirm: true.

On staging, check that the returned start and end carry the intended date, time and offset, that venue_id matches, that the event page shows the right venue, and that the event appears on the calendar for that day. If the whole request was a mistake, wppilot/rollback-change on the create removes the event, but the publishing edit itself is recorded as irreversible.

Questions about The Events Calendar

Can the agent see who bought tickets?

No. The ticket call returns inventory and pricing per ticket and leaves attendee details out.

Does deleting an event remove it for good?

Not unless force=true is sent. By default it goes to the trash, where it can be restored in wp-admin.

Why is an event I can see in wp-admin missing from the list?

The listing returns published events unless told otherwise. Pass status as draft, pending, private or future to see the others.

The Events Calendar reads

AbilityWhat it does
wppilot/events-calendar-check-setupCheck Events Calendar SetupReports The Events Calendar runtime, event counts, management capability, and optional Event Tickets availability/version.
wppilot/events-calendar-get-eventGet EventReads one event including content, dates, timezone, all-day state, venue, organizers, cost, website, and event categories.
wppilot/events-calendar-list-event-ticketsList Event TicketsLists the ticket and RSVP inventory attached to one event through Event Tickets. It never returns attendee personal data and performs no sales mutation.
wppilot/events-calendar-list-eventsList EventsLists The Events Calendar events using its public query API with status, search, date-range, and bounded pagination filters.

The Events Calendar writes

AbilityWhat it does
wppilot/events-calendar-create-eventCreate EventCreates a real The Events Calendar event through its public event API. Start and end use Y-m-d H:i:s; drafts are the default.

Destructive The Events Calendar calls

AbilityWhat it does
wppilot/events-calendar-delete-eventDelete EventMoves an event to trash by default or permanently deletes it when force=true. Both paths require explicit confirmation.
wppilot/events-calendar-edit-eventEdit EventPartially updates an existing event through The Events Calendar event API and verifies the stored result.

For the task-level view of The Events Calendar, with worked requests and what to check afterwards, see The Events Calendar integration page.