benecaster_request_episode_transcription()
benecaster_request_episode_transcription( int $episode_id, string $audio_variant_key = '' ): int|WP_Error
Queues one audio source for transcription, exactly as Request transcription on Benecaster → Episodes does. A transcription already pending or processing is left as it is and its id returned; a failed one is queued again; a finished one is never replaced this way.
This spends the podcaster’s money with their own provider once the queue sends it. Call it only on the podcaster’s own click, after showing what it will cost, as the episode list and the bulk confirmation do.
Parameters
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
$episode_id |
int |
— | Yes | The episode. |
$audio_variant_key |
string |
'' |
No | '' for the base audio, or a tier's audio variant key. |
Return Value
Type:
int|WP_Error
The transcript id, or a WP_Error with a translated message and a status: 404 benecaster_transcription_not_an_episode, 403 benecaster_transcription_not_active (off for the episode's show), 409 benecaster_transcription_not_configured (no provider has accepted a key), 409 benecaster_transcription_no_audio, 409 benecaster_transcription_already_complete or 500 benecaster_transcription_not_saved.
Example
if ( current_user_can( 'manage_options' ) && function_exists( 'benecaster_request_episode_transcription' ) ) {
$result = benecaster_request_episode_transcription( $episode_id ); // Only on the podcaster's confirmed click.
}
Notes
It checks no capability: decide whether the current request may spend the podcaster's money (at least manage_options) before calling it. From a browser, use the per-show route POST /benecaster-transcription/v1/shows/{show_id}/episodes/{episode_id}/transcription (optional variant), which checks manage_options, the nonce and the show; its status counterpart is GET …/shows/{show_id}/episodes/transcription-status?ids=…. Defined on every request while the add-on is active; guard with function_exists().
Need this built rather than just documented? See our services →