Offer episode downloads to paying subscribers only
With Show a download link on episode pages switched on, 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 host’s audio URL, 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 →