React when a migration brings transcripts across
The wizard’s optional last step reads <podcast:transcript> tags out of the feed a podcaster is leaving and hands each file to the Transcription Service. To log which episodes kept their transcripts, or to re-index them, hook benecaster_migration_transcript_imported.
$format is the <podcast:transcript> type as the feed wrote it (text/vtt, application/x-subrip, text/plain, case and ; charset=… as found), not Transcription’s format slug. For the slug, listen to benecaster_transcript_imported.
To react to any transcript arriving, this is the wrong hook. Use benecaster_transcript_updated, which covers every source including a correction. This one answers the narrower question: did a migration bring this one in?
To drive the step yourself, POST shows/{show_id}/transcripts with an optional feed_url and read the summary. Only failed means something went wrong: withoutTranscript is ordinary (Castos emits no transcript tag at all, so 0 of 52 is a correct result) and alreadyHad is what makes running it again safe.
Code
<?php
add_action( 'benecaster_migration_transcript_imported', function (
int $episode_id,
int $transcript_id,
string $format,
string $source_url
): void {
// $format is the feed tag's own type: "text/vtt", not "vtt".
error_log( sprintf( 'Migrated transcript for episode %d from %s', $episode_id, $source_url ) );
}, 10, 4 );
Hooks Used
Need this built rather than just documented? See our services →