Following up on this post on custom taxonomies, is there an error in line 61 where taxonomy is set to 'topic-tag'?
Wsherliker, the original author, had:
// Added custom taxonomy support
if ($this->params['taxonomy'] != "" && $this->params['tags'] != "") {
$args['tax_query'] = array(array(
'taxonomy' => 'topic-tag',
'field' => 'slug',
'terms' => explode(",",$this->params['tags'])
));
} elseif ($this->params['tags'] != "") {
$args['tag'] = $this->params['tags'];
}
But shouldn't that be:
// Added custom taxonomy support
if ($this->params['taxonomy'] != "" && $this->params['tags'] != "") {
$args['tax_query'] = array(array(
'taxonomy' => $this->params['taxonomy'],
'field' => 'slug',
'terms' => explode(",",$this->params['tags'])
));
} elseif ($this->params['tags'] != "") {
$args['tag'] = $this->params['tags'];
}
so that it gets the taxonomy as a parameter?
For me, the original code didn't work to grab a custom taxonomy, but my modified code worked fine.
Also, can multiple custom taxonomies be supported? This could be done with the relation setting of tax_query, but I couldn't find where this was implemented. Any plans to add?