| | |
| | | $this->cache_name = 'terms'; |
| | | parent::__construct(); |
| | | if (JVB_TESTING) { |
| | | $this->cache->clear(); |
| | | $this->cache->flush(); |
| | | } |
| | | $this->per_page = 20; |
| | | |
| | |
| | | |
| | | $data = [ |
| | | 'id' => $term->term_id, |
| | | 'name' => $term->name, |
| | | 'name' => html_entity_decode($term->name), |
| | | 'slug' => $term->slug, |
| | | 'taxonomy' => $term->taxonomy, |
| | | ]; |
| | |
| | | $term = get_term($rel->related_term_id, $rel->related_taxonomy); |
| | | return [ |
| | | 'id' => $rel->related_term_id, |
| | | 'name' => $term ? $term->name : 'Unknown', |
| | | 'name' => $term ? html_entity_decode($term->name) : 'Unknown', |
| | | 'count' => $rel->relationship_count |
| | | ]; |
| | | }, $relationships); |
| | |
| | | return $this->cache->remember($cache_key, function() use ($term, $taxonomy) { |
| | | $data = [ |
| | | 'id' => $term->term_id, |
| | | 'name' => $term->name, |
| | | 'name' => html_entity_decode($term->name), |
| | | 'slug' => $term->slug, |
| | | 'parent' => $term->parent, |
| | | 'path' => $this->getTermPath($term->term_id, $term->name, $taxonomy), |
| | |
| | | 'message' => 'Term already exists', |
| | | 'term' => [ |
| | | 'id' => $term->term_id, |
| | | 'name' => $term->name, |
| | | 'name' => html_entity_decode($term->name), |
| | | 'path' => $this->getTermPath($term->term_id, $term->name, $taxonomy) |
| | | ] |
| | | ]); |