Hello,
I try to exclude from search the taxonomy “product_brand” if count = 0
I’v put in function.php this function (14 is the id of brand search)
[php]add_filter("asp_query_args", "asp_query_args_change", 1, 14);
function asp_query_args_change($args, $search_id)
{
// Find "product_brand" where count = 0 and exclude from search
//$brands = $wpdb->get_results("");
//update phiz_term_taxonomy p set p.count = 0 where p.term_id not in (select term_taxonomy_id from phiz_term_relationships)
// Filter it
$args[‘post_tax_filter’] = array(
array(
‘taxonomy’ => ‘product_brand’,
‘exclude’ => $brands
)
);
return $args;
}[/php]
How can I get all id with count 0 of taxonomy “product_brand” ?
This is the right function ?
Thanks
Ilan