Skip to main content

benecaster_archive_show_filters

Filter Free

Filters whether the episode filter/sort bar is rendered. Return false to suppress it entirely — useful when the archive is embedded in a layout where filtering is handled externally.

Return a boolean. Returning false suppresses the filter bar entirely — the template returns before rendering, so no markup is emitted. $show_id is 0 on the global archive.

Parameters

Name Type Default Description
$show_filters bool Whether to render the filter bar; default true
$show_id int ID of the show

Returns: bool

Example

add_filter( 'benecaster_archive_show_filters', function( $show_filters, $show_id ) {
    // Suppress the filter bar when the archive is embedded via shortcode in a sidebar.
    if ( is_active_sidebar( 'benecaster-archive-sidebar' ) ) {
        return false;
    }
    return $show_filters;
}, 10, 2 );

Affects

  • archive/filters.php template part

Need this built rather than just documented? See our services →