Skip to main content

benecaster_ssp_import_after

Action Free

Fires after Benecaster’s episode import has processed every published Seriously Simple Podcasting episode for a show. Benecaster detects SSP episodes on the same WordPress site by itself, with nothing to configure, and the import runs in the background whether it was started from the setup wizard’s import step or from Benecaster → Settings → Tools → Import Episodes.

This hook fires whether or not any new episodes were created: check $imported > 0 if you only want to react to runs that produced new drafts. The import is safe to re-run — each episode is tracked by the SSP post it came from, so previously imported episodes increment $skipped rather than creating duplicates.

On a site with both SSP and PowerPress episodes, one import imports both, SSP first: every benecaster_ssp_episode_imported, then this hook, then every benecaster_powerpress_episode_imported, then benecaster_powerpress_import_after. Both import screens start that kind of import. $imported and $skipped count SSP posts only, not the whole job’s total.

The import spans several WP-Cron runs. This hook fires once per source, from the run that ends the pass, with that pass’s counts across runs.

Parameters

Name Type Default Description
$show_id int — ID of the show
$imported int — Number of episodes successfully imported
$skipped int — Number of SSP posts skipped because they were already imported

Examples

Send Slack notification after SSP import

add_action( 'benecaster_ssp_import_after', function ( int $show_id, int $imported, int $skipped ): void {
    if ( $imported === 0 ) {
        return; // Nothing new — skip the notification.
    }

    $message = sprintf(
        'SSP import for show %d complete — %d new drafts created, %d skipped.',
        $show_id,
        $imported,
        $skipped
    );

    wp_remote_post( MY_SLACK_WEBHOOK_URL, [
        'body'    => wp_json_encode( [ 'text' => $message ] ),
        'headers' => [ 'Content-Type' => 'application/json' ],
    ] );
}, 10, 3 );

Notes

Fires on every run, including runs that create no new drafts. Guard with $imported > 0 to avoid unnecessary work on empty runs.

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