Skip to main content

benecaster_show_episode_list_args

Filter Free

Filters the WP_Query arguments for the embedded episode list in show/episode-list.php. Defaults: posts_per_page=10, orderby=date, order=DESC. Use to show only specific episode types, seasons, or a custom count.

Return the arguments array. Cast with (array), and passed straight to WP_Query.

The defaults are post_type (the Benecaster episode CPT), post_parent (the show), post_status publish, posts_per_page 10, ordered by date.

Returning an empty array does not restore the defaults — it runs an unscoped WP_Query, which drops post_parent and lists episodes from every show on the site. Always modify and return the array you were given rather than building one from scratch. Changing post_type away from the episode CPT will render cards against posts that have no episode meta.

Parameters

Name Type Default Description
$args array WP_Query arguments array
$show_id int ID of the show

Returns: array

Example

add_filter( 'benecaster_show_episode_list_args', function( $args, $show_id ) {
    // Show only the 5 most recent full-length episodes; exclude trailers.
    $args['posts_per_page'] = 5;
    $args['meta_query'] = [
        [ 'key' => '_benecaster_episode_type', 'value' => 'trailer', 'compare' => '!=' ],
    ];
    return $args;
}, 10, 2 );

Affects

  • show/episode-list.php template part