Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply facets filters directly into the ES query and support and/or across different facet types #3045

Merged
merged 14 commits into from
Oct 17, 2022
Merged
Prev Previous commit
Next Next commit
If any filter is selected, do not display sticky posts
  • Loading branch information
felipeelia committed Oct 5, 2022
commit 3f3b0ce3328cb14dace523dd873dcdd6f93b65d0
6 changes: 6 additions & 0 deletions includes/classes/Feature/Facets/Facets.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ public function facet_query( $query ) {
return;
}

// If any filter was selected, there is no reason to prepend the list with sticky posts.
$selected_filters = $this->get_selected();
if ( ! empty( $selected_filters ) ) {
$query->set( 'ignore_sticky_posts', true );
}

/**
* Filter facet aggregations.
*
Expand Down