function specific_data($term, $depth) { $tmp = $this->selected_terms; $i = array_search($term->slug, $tmp); if (false === $i) { $tmp[] = $term->slug; $data['title'] = __('Add term', 'query-multiple-taxonomies'); } else { unset($tmp[$i]); $data['title'] = __('Remove term', 'query-multiple-taxonomies'); } $data['url'] = QMT_URL::for_tax($this->taxonomy, $tmp); return $data; }
private function generate_lists($taxonomies, $data) { $query = qmt_get_query(); foreach ($taxonomies as $taxonomy) { $terms = $this->get_terms($taxonomy); if (empty($terms)) { continue; } $walker = new QMT_List_Walker($taxonomy, 'list'); $data_tax = array('taxonomy' => $taxonomy, 'title' => get_taxonomy($taxonomy)->label, 'term-list' => $walker->walk($terms, 0), 'any-text' => __('any', 'query-multiple-taxonomies')); if (isset($query[$taxonomy])) { $data_tax['clear'] = array('url' => QMT_URL::for_tax($taxonomy, ''), 'title' => __('Remove selected terms in group', 'query-multiple-taxonomies')); } $data['taxonomy'][] = $data_tax; } return self::mustache_render('lists.html', $data); }