Reply To: Fronted Search Setting options [esclude terms empty]

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Fronted Search Setting options [esclude terms empty] Reply To: Fronted Search Setting options [esclude terms empty]

#10417

Ernest Marcinko
Keymaster

Hi Claudio!

It is actually possible with a filter. Use this code for your case to filter the “luoghi” taxonomy:

add_filter( 'asp_fontend_get_taxonomy_terms', 'asp_filter_empty_terms', 1, 3 );

function asp_filter_empty_terms($terms, $taxonomy, $args) {
  if ( $taxonomy == 'luoghi' ) {
    return get_terms($taxonomy, array(
      'orderby' => $args['orderby'], 
      'order' => $args['order'],
      'taxonomy'=> $taxonomy,
      'hide_empty' => 1  
    ));
  }  
  return $terms;
}
Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)