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]

#10418
K15Lmk98
K15Lmk98
Participant

Hi Ernest,

Thanks for the filter.
I just wanted to take the term parent, and I modified the code with ‘parent’ => 0:

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,
      'parent ' => 0,
      'hide_empty' => 1  
    ));
  }  
  return $terms;
}

But strangely always returns the children – see screnshot –

You have a solution?

Thanks, Claudio_

Attachments:
You must be logged in to view attached files.