Browser: Chrome 110
OS: macOS
URL: https://welcometomosaic.com/events/
Summary
When a Query Filter (Select/Radio/Checkbox) targets a Query Loop whose post type is The Events Calendar’s tribe_events, every option renders disabled (brx-option-disabled) on the front end — even on first load with no active filter. The loop renders events fine, and filtering by URL param returns correct results; only the option UI is disabled, so visitors can’t pick a value.
Two things to rule out up front:
-
The query loop is on the page and renders results (so this is not the known “no query loop on page → count 0” case).
-
The identical filter setup works on a normal CPT — it only breaks when the target is a
tribe_eventsloop.
Looks like a regression: the triggering code is tagged @since 2.3, and this worked before updating Bricks.
Environment
Bricks 2.3.8 · The Events Calendar (free) 6.16.5 and (pro) 7.7.16 · WordPress 7.0 · PHP 8.5 · no other filter plugins · reproduced with our custom code fully disabled.
Steps to reproduce (no access to our site needed)
-
Clean WP + Bricks + The Events Calendar (free).
-
Create ~8–10 events across 2–3 Event Categories (
tribe_events_cat); include a recurring event. -
Enable Query Filters (Bricks → Settings → Query Filters).
-
Add a Query Loop: post type Events (
tribe_events). -
Add a Filter – Select, Source Taxonomy → Event Categories, Target = that loop.
-
Regenerate the filter index.
-
View on the front end.
Expected: category options are selectable. Actual: every option has the disabled attribute / brx-option-disabled class.
Likely root cause (from source)
In includes/elements/filter-base.php, options are force-disabled when the target query count is 0:
php
// ~line 782
if ( $query_results_count == 0 && $this_active_filter === false ) {
$option['count'] = 0;
}
// ~line 789
if ( $option['count'] === 0 && ! $option['is_all'] && ! $option['is_placeholder'] ) {
$option['disabled'] = true;
$option['class'] .= ' brx-option-disabled';
}
$query_results_count comes from the {query_results_count:<queryId>} tag (~line 118). For a tribe_events loop it resolves to 0 at filter-prep time, even though running the loop’s query directly returns the real total (e.g. found_posts = 132). We believe this is because The Events Calendar rewrites/owns tribe_events queries via pre_get_posts, so the count Bricks reads is 0.
Quick verification: output {query_results_count:<loopId>} on a page with a tribe_events loop — it returns 0 on the front end while the loop renders results. Same tag on a normal CPT returns the correct number.
Already tried (no effect)
tribe_suppress_query_filters via pre_get_posts and bricks/posts/query_vars; adding/removing a date meta_query; regenerating the index; cache purges; bricks/filter_element/populated_options to clear the flag.
Suggested fix
Don’t disable all options based solely on $query_results_count == 0 when the query actually returns posts — or add a filter to override target_query_results_count so plugins like The Events Calendar can supply the correct count.
Thanks!