Skip to main content

benecaster_podcast_workflow_before_task_status_change

Action Premium podcast-workflow

Fires before the status of one task in an episode’s Podcast Workflow production plan changes, only when it changes.

Parameters

Name Type Default Description
$episode_id int — The episode whose plan holds the task
$task_id string — The task's `id` in the plan
$new_status string — `not_started`, `in_progress`, `blocked` or `complete`
$old_status string — The status before the change, one of the same four
$show_id int — The episode's own show

Example

add_action( 'benecaster_podcast_workflow_before_task_status_change', function ( int $episode_id, string $task_id, string $new_status, string $old_status, int $show_id ): void {
    my_audit_log( 'workflow-task-status-changing', $episode_id, "$task_id: $old_status -> $new_status" );
}, 10, 5 );

Notes

Late is worked out when shown and is never a status, so no hook fires when a task becomes late. The plan's own save actions fire too. Walkthrough: Read and set the status of a task in an episode's production plan, and run code when one changes.

Affects

  • Workbench
  • PUT benecaster-podcast-workflow/v1/shows/{show_id}/episodes/{episode_id}/plan/tasks/{task_id}/status

Need this built rather than just documented? See our services →