benecaster_podcast_workflow_before_save_plan
Fires before every write of an episode’s Podcast Workflow production plan: starting it, changing its tasks, finalising it or sending it back to draft, and setting a task’s status.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$episode_id |
int |
— | The episode whose plan is being written |
$plan |
array |
— | The plan as stored: `{ tasks: [ { id, name, offset_days, duration_days, preset_id, status } ], finalised, finalised_at }` |
$show_id |
int |
— | The episode's own show |
Example
add_action( 'benecaster_podcast_workflow_before_save_plan', function ( int $episode_id, array $plan, int $show_id ): void {
my_audit_log( 'workflow-plan-saving', $episode_id, count( $plan['tasks'] ) . ' tasks' );
}, 10, 3 );
Notes
A plan moves with its episode and there is no move hook to add. Due dates are relative to the publish date and never stored. Walkthrough: Read or change an episode's production plan, change how a new plan starts, and run code when a plan is finalised.
Affects
- Workbench
- POST benecaster-podcast-workflow/v1/shows/{show_id}/episodes/{episode_id}/plan
- PUT benecaster-podcast-workflow/v1/shows/{show_id}/episodes/{episode_id}/plan
- PUT benecaster-podcast-workflow/v1/shows/{show_id}/episodes/{episode_id}/plan/finalised
- 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 →