Skip to main content

Trigger a workflow when a new episode is first created

Free Beginner Since v1.0.0

Fires exactly once per episode lifetime on the first save. Use to bootstrap external records — a project management task, a CMS entry, or an audit trail row — before the episode enters the editorial workflow. Note: meta (audio URL, description, etc.) is not yet written when this fires; read it lazily or hook updated_post_meta if needed.

Code

<?php
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 );

View on GitHub →

Hooks Used