benecaster_episode_created
Fires after a new episode is saved for the first time. Use this hook to set up related data, trigger external syncs, or create matching records in connected systems.
This hook fires only on the episode’s very first save — subsequent saves fire [benecaster_episode_updated](/hooks/benecaster_episode_updated/) instead. An episode may be created as a draft and published much later; [benecaster_episode_created](/hooks/benecaster_episode_created/) fires at creation time regardless of the initial post status.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$episode_id |
int |
— | ID of the new episode post |
$show_id |
int |
— | ID of the parent show |
Examples
Create PM task on episode creation
add_action( 'benecaster_episode_created', function( int $episode_id, int $show_id ) {
my_pm_create_task( [
'name' => get_the_title( $episode_id ),
'show_id' => $show_id,
'wp_id' => $episode_id,
'status' => 'draft',
] );
}, 10, 2 );
Notes
Episode meta fields (audio URL, episode description, artwork URL, guests, references, and all other custom episode data) are written after the save_post hook completes. If your callback needs meta values, read them with get_post_meta() — the values will be current within the same request.