benecaster_content_calendar_after_delete_item
Fires once a Content Calendar content item has been deleted: from the Calendar screen or over the REST API, or because the episode it is linked to was deleted for good. It fires only when the delete succeeded.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$item |
array |
— | The content item as it was before it was deleted. Its fields are listed in the walkthrough below. |
$context |
string |
— | `delete`, or `episode_deleted` (the linked episode was deleted for good) |
Example
add_action( 'benecaster_content_calendar_after_delete_item', function ( array $item, string $context ): void {
my_social_scheduler_cancel( $item['id'] );
}, 10, 2 );
Notes
Moving an episode to the Trash deletes nothing, so it does not fire this. The episode_deleted context fires even while Content Calendar is off for every show. Walkthrough, with every field of $item: Run your own code when a Content Calendar content item is saved or deleted.
Affects
- Calendar screen
- DELETE benecaster-content-calendar/v1/shows/{show_id}/items/{id}
Need this built rather than just documented? See our services →