Skip to main content

benecaster_episode_nav_next

Filter Free Since v1.0.0

Filters the WP_Post object for the next episode in episode/navigation.php. Return null to suppress the next link.

Parameters

Name Type Default Description
$post WP_Post|null Next episode WP_Post object, or null if there is no next episode
$episode_id int ID of the current episode
$show_id int ID of the show

Returns: WP_Post|null

Example

add_filter( 'benecaster_episode_nav_next', function( $post, $episode_id, $show_id ) {
    // Hide the "next" link for subscribers who shouldn't see unreleased episodes.
    if ( $post && get_post_meta( $post->ID, '_benecaster_hide_nav', true ) ) {
        return null;
    }
    return $post;
}, 10, 3 );

Affects

  • episode/navigation.php template part