Skip to main content

benecaster_content_calendar_after_delete_idea

Action Premium content-calendar

Fires once a Content Calendar idea has been deleted: from a show’s Ideas board or over the REST API, or because it was put on the calendar. It fires only when the delete succeeded.

Parameters

Name Type Default Description
$idea array — The idea as it was before it was deleted. Its fields are listed in the walkthrough below.
$context string — `delete`, or `promote` (the idea left the board because it was put on the calendar; the new content item has already been saved)

Example

add_action( 'benecaster_content_calendar_after_delete_idea', function ( array $idea, string $context ): void {
    if ( 'promote' === $context ) {
        my_log( sprintf( 'Idea "%s" went on show %d\'s calendar.', $idea['title'], $idea['show_id'] ) );
    }
}, 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 →