benecaster_podcast_workflow_after_save_plan
Fires once an episode’s Podcast Workflow production plan has been written: started, its tasks changed, finalised or sent back to draft, or a task’s status set. It fires only once the write is done.
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_after_save_plan', function ( int $episode_id, array $plan, int $show_id ): void {
update_post_meta( $episode_id, '_my_plugin_task_count', count( $plan['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 →