benecaster_content_calendar_before_delete_idea
Fires before a Content Calendar idea is deleted: from a show’s Ideas board or over the REST API, or because it was put on the calendar.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$idea |
array |
— | The idea about to be deleted. Its fields are listed in the walkthrough below. |
$context |
string |
— | `delete`, or `promote` (the idea is leaving the board because it was put on the calendar; the new content item has already been saved) |
Example
add_action( 'benecaster_content_calendar_before_delete_idea', function ( array $idea, string $context ): void {
my_audit_log( 'calendar-idea-deleting', $idea['show_id'], $idea['title'] . ' (' . $context . ')' );
}, 10, 2 );
Notes
With promote, the new content item is saved first, through the content item save hooks with $context promote (Run your own code when a Content Calendar content item is saved or deleted). Each idea is { id, show_id, type, type_name, title, notes, position, created_by, created_at, updated_at }. Walkthrough: Run your own code when a Content Calendar idea is saved, deleted or rearranged.
Affects
- Ideas board
- DELETE benecaster-content-calendar/v1/shows/{show_id}/ideas/{id}
- POST benecaster-content-calendar/v1/shows/{show_id}/ideas/{id}/promote
Need this built rather than just documented? See our services →