Skip to main content

benecaster_archive_show_filters

Filter Free Since v1.0.0

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.

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