Skip to main content

benecaster_episode_move_before

Action Free

Fires when an episode is about to move to another show, after the move has passed every check and before anything is written. A podcaster moves an episode by picking another show in the episode editor’s Show field, which sends PUT /episodes/{id} with the other show’s ID.

Use it to read anything you need from the old show before the move changes it. By the time benecaster_episode_move_after fires, the episode’s per-show rows are gone.

It never fires for a refused move: one blocked by a required buy-up, by access a listener bought, or by benecaster_episode_move_blockers. Every _before is followed by an _after in the same request, unless the episode’s own post update fails. In that case the request returns 500 update_failed, and the episode stays on its old show with its schedule untouched.

Parameters

Name Type Default Description
$episode_id int — ID of the episode being moved
$from_show_id int — ID of the show it is leaving
$to_show_id int — ID of the show it is moving to

Examples

Note the old show's settings before a move

add_action( 'benecaster_episode_move_before', function (
    int $episode_id,
    int $from_show_id,
    int $to_show_id
) {
    update_post_meta(
        $episode_id,
        '_my_plugin_previous_sponsor',
        get_post_meta( $from_show_id, '_my_plugin_sponsor', true )
    );
}, 10, 3 );

Notes

A move is not a delete. benecaster_episode_deleted does not fire, and nothing should be removed only because an episode left a show.

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