Skip to main content

benecaster_episode_share_links

Filter Free Since v1.0.0

Filters the share links array for an episode before output in episode/share.php. Each entry is {label, url, class}. Replace the whole array to swap platforms; append to add a platform alongside the defaults.

Parameters

Name Type Default Description
$links array Share links array; each entry: {label: string, url: string, class: string}
$episode_id int ID of the episode
$show_id int ID of the show

Returns: array

Example

add_filter( 'benecaster_episode_share_links', function( $links, $episode_id, $show_id ) {
    // Add a Bluesky share link after the existing entries.
    $title      = urlencode( get_the_title( $episode_id ) );
    $permalink  = urlencode( get_permalink( $episode_id ) );
    $links[] = [
        'label' => 'Bluesky',
        'url'   => 'https://bsky.app/intent/compose?text=' . $title . '%20' . $permalink,
        'class' => 'bc-share-bluesky',
    ];
    return $links;
}, 10, 3 );

Affects

  • episode/share.php template part