Skip to main content

benecaster_outlinks_disclosure_text

Filter Premium outlinks

Filters the affiliate disclosure line Outlinks prints above an episode’s references on its single episode page. $text is the show’s own wording from Show Settings → Outlinks → Affiliate disclosure, or the default: “This episode contains affiliate links — we may earn a commission at no extra cost to you.”

It runs only when the line is about to print: Outlinks is switched on for the show, the show’s disclosure is on, and at least one of the episode’s references has a tracked link with an affiliate URL (on the link itself or on one of its country rules; an expired link still counts). So it cannot add a disclosure to an episode with no affiliate links.

The line is printed from Benecaster’s benecaster_before_episode_references action. A theme that overrides the episode references template and leaves that action out gets no line and no filter call.

Parameters

Name Type Default Description
$text string — The show's disclosure text, or the default
$show_id int — ID of the episode's show

Returns: string

Example

add_filter( 'benecaster_outlinks_disclosure_text', function ( string $text, int $show_id ): string {
    if ( 12 === $show_id ) {
        return ''; // This show discloses in its own episode template.
    }
    return $text . ' ' . __( 'Thank you for supporting the show.', 'my-theme' );
}, 10, 2 );

Notes

Plain text only: the return is trimmed and escaped, so HTML shows as text. Return '', or anything that is not a string, to print nothing. To change the stored wording rather than the line at render time, use the show's Affiliate disclosure setting or its REST route. Walkthrough: Change or remove the affiliate disclosure line on episode pages.

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