public function term_link($link, $term, $tax)
 {
     $cache_key = 'term:' . $term->term_id;
     if (false === ($_link = $this->cache->get($cache_key))) {
         if (in_array($tax, $this->model->get_filtered_taxonomies())) {
             $_link = $this->links_model->add_language_to_link($link, $this->curlang);
             $_link = apply_filters('pll_term_link', $_link, $this->curlang, $term);
         } else {
             $_link = parent::term_link($link, $term, $tax);
         }
         $this->cache->set($cache_key, $_link);
     }
     return $_link;
 }
Beispiel #2
0
 public function term_link($link, $term, $tax)
 {
     if (isset($this->links[$link])) {
         return $this->links[$link];
     }
     return $this->links[$link] = $tax == 'post_format' ? $this->links_model->add_language_to_link($link, $this->curlang) : ($this->options['force_lang'] ? parent::term_link($link, $term, $tax) : $link);
 }