Skip to main content

benecaster_transcript_locked_html

Filter Premium transcription

The space where the Transcription Service add-on would show a transcript, for a visitor its visibility setting excludes. $html is the show’s teaser, chosen on its Transcription settings tab, or '' while the teaser is off, which is the default. Return '' to remove it, $html to keep it, or your own markup to replace it.

The teaser is section.benecaster-transcript.benecaster-transcript--locked[data-benecaster-transcript-locked], with an optional ol.benecaster-transcript__teaser-lines of the first lines, then p.benecaster-transcript__locked-notice and p.benecaster-transcript__locked-link. It carries no download link and no transcript file address.

It is asked only when the episode has a finished transcript for its main audio and benecaster_user_can_see_transcript() says no for the current visitor. It is never asked for a transcript set to Hidden, which is never on a page: nothing may say a Hidden transcript exists.

It applies wherever the add-on shows a transcript: benecaster_transcript, and the episode page, where $mode is scrollable and your output sits under the page’s Transcript heading.

What you return is output as given, not escaped: escape what you build. Nothing is enqueued for it.

Parameters

Name Type Default Description
$html string — The show's teaser markup, or `''` while the teaser is off
$episode_id int — ID of the episode
$mode string — `full`, `preview` or `scrollable`; `scrollable` on the episode page

Returns: string

Example

add_filter( 'benecaster_transcript_locked_html', static function ( string $html, int $episode_id ): string {
    return '<p class="my-transcript-locked">' . esc_html__( 'Members can read along with every episode.', 'my-theme' ) . '</p>';
}, 10, 2 );

Notes

The add-on never passes the transcript's text here. Putting any of it in your output would hand it to the people the setting excludes. Walkthrough: Put an episode's transcript on any page, and tell locked-out visitors how to read it.

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