30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Trash Event

events/trash-event moves an event to the trash. It refuses without confirm: true.

Trash, never permanent deletion — and that distinction is not a preference here, it is a correctness requirement.

Before you run it

This takes the event off the calendar. It goes to the trash and can be restored from the WordPress admin, but anyone holding a link to it gets a 404 from the moment the call returns, and any page listing it stops listing it. The gate is on the word, not the outcome — the event is recoverable from the trash. It exists because “cancel the November workshop” and “remove the November workshop from the site” are different requests, and an assistant cannot always tell which one it heard.

At a glance

Abilityevents/trash-event
ToolsetThe Events Calendar — toolset/events-calendar
GroupThe Events Calendar › Events
RequiresThe Events Calendar, active on the site
Capabilitymanage_options
SafetyDestructive — moves the post to the trash, and refuses to run without confirm: true. Recoverable from the WordPress trash.
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

WordPress only auto-trashes ordinary posts and pages. Hand any other post type to wp_delete_post() with default arguments and it is removed outright, meta and all, with nothing in the trash to restore. An event is a custom post type. So the obvious implementation of “delete this event” deletes it permanently, and the obvious way to test that — checking the trash — shows nothing there because nothing was trashed.

This ability moves the post to the trash explicitly. There is no permanent-delete variant, and adding one would mean building an irreversible operation on top of an API whose default behaviour is already the dangerous one.

If the site has the trash disabled — some do, with EMPTY_TRASH_DAYS set to zero — there is no trash to move the event into, and the call is refused rather than falling back to deletion.

Input

NameTypeRequiredWhat it is
idintegerYesThe event ID.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
idintegerThe event ID.
trashedbooleanWhether the move succeeded.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Take the cancelled November workshop off the calendar.

It resolves to one call:

{
  "ability": "events/trash-event",
  "parameters": {
    "id": 1840,
    "confirm": true
  }
}

Worth knowing

  • Restore from Events › Events › Trash in the admin. This suite does not un-trash.
  • Tickets sold against the event are not touched. Trashing an event people have paid to attend is a business decision, not a cleanup.
  • Refused outright on a site with the trash disabled.
  • A draft that was never published can be trashed the same way. The confirmation is still required.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading