Queries
breakdance_query_control_query($query) receives an argument array or query string and returns the corresponding kind. It receives no element/post ID.
add_filter('breakdance_query_control_query', function ($query) {
if (is_array($query) && ($query['acme_event_listing'] ?? false)) {
$query['orderby'] = 'date';
$query['order'] = 'DESC';
}
return $query;
});
acme_event_listing is your extension marker, not a built-in setting. Other queries pass unchanged.
Scope callbacks to the intended query. WooCommerce, term, custom PHP, and other renderer paths may differ; older query_builder hooks are not interchangeable. Check sorting, counts, pagination, and unrelated listings when applying changes.
For UI configuration, see Dynamic Data queries.
Opt Queries into FacetWP
The canonical GitHub example opts queries into FacetWP. It names breakdance_query_builder_input_query, which is not a dispatched hook in the current implementation. Use breakdance_query_control_query, as Breakdance's integration does:
add_filter('breakdance_query_control_query', function ($query) {
if (is_string($query)) {
return $query . '&facetwp=true';
}
$query['facetwp'] = true;
return $query;
});
This example changes every query reaching the filter. Add your own condition when only selected listings should participate. See the original example.