Offer episode downloads to paying subscribers only
With the show’s download link switched on (Show a download link on episode pages, or Show a download link on video-only episodes for an episode whose only file is a video), the “Download episode” link shows to everyone who can play the episode, including every visitor on a public episode. This keeps it for subscribers.
The filter can only hide the link. Returning true for a visitor who can’t play the episode, or on a show where the setting is off, shows nothing, so a trial-access callback that unlocks the player does not extend downloads to trial users. The link is the file at your host, the same one the player uses.
Code
<?php
add_filter( 'benecaster_show_episode_download', function ( bool $show, int $episode_id, ?int $user_id, ?string $user_tier ): bool {
return $show && null !== $user_tier;
}, 10, 4 );
Hooks Used
Need this built rather than just documented? See our services →