Skip to content

Commit

Permalink
Create a new "ep_facet_search_get_terms_args" filter
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Oct 15, 2020
1 parent 0ef93c4 commit 7787dcd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions includes/classes/Feature/Facets/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,24 @@ public function widget( $args, $instance ) {
* Get all the terms so we know if we should output the widget
*/
$terms = get_terms(
array(
'taxonomy' => $taxonomy,
'hide_empty' => true,
/**
* Filter arguments passed to get_terms() while getting all possible terms for the facet widget.
*
* @since 3.5.x
* @hook ep_facet_search_get_terms_args
* @param {array} $query Weighting query
* @param {string} $post_type Post type
* @param {array} $args WP Query arguments
* @return {array} New query
*/
apply_filters(
'ep_facet_search_get_terms_args',
[
'taxonomy' => $taxonomy,
'hide_empty' => true,
],
$args,
$instance
)
);

Expand Down

0 comments on commit 7787dcd

Please sign in to comment.