benecaster_related_episodes_query_types
Registers additional query strategies for the Related Episodes block and shortcode. Each key in the returned array is a type slug; each value is an object implementing the query interface with two methods: `get_label()` returns a display name shown in the Episode Page settings panel, and `get_results( $episode_id, $show_id, $args )` returns an array of related episode posts. Always honor the `count` key in `$args`.
New types appear automatically in the query type selector in the Episode Page settings panel and are available as the `type` attribute of [benecaster_related_episodes]. Tier-aware filtering is handled by the renderer — query implementations do not need to filter by subscriber tier. Built-in types: `by_tag`, `by_season`, `by_guest`, `latest`.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$types |
array |
— | Keyed array of query type instances implementing BenecasterRelatedEpisodesQueryInterface |
Returns:
array
Examples
Register custom topic-based query type
add_filter( 'benecaster_related_episodes_query_types', function ( $types ) {
$types['by_topic'] = new My_Plugin_By_Topic_Query();
return $types;
} );
Affects
- [benecaster_related_episodes] shortcode
- Related Episodes Episode Page block
- Settings → Show → Episode Page query type picker