Skip to main content

Run your own code when an episode’s workflow status, recording or outline changes in Podcast Workflow

Premium Intermediate Podcast Workflow

An episode’s workflow status is draft, review, approved, scheduled or published. Review and Approved are Podcast Workflow’s own record (post meta _benecaster_workflow_status), never a post_status: Benecaster keeps post_status to draft, future, publish and private. Scheduled and Published are read from the post (private counts as published) and are never set through these hooks.

$show_id is the episode’s own show. An after hook fires only once the write is done.

Code

<?php
add_action( 'benecaster_podcast_workflow_after_status_change', function ( int $episode_id, string $new, string $old, int $show_id ): void {
    if ( 'approved' === $new ) {
        my_plugin_tell_the_editor( $episode_id ); // e.g. post to the team's chat
    }
}, 10, 4 );

View on GitHub →

Hooks Used

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