You are here

protected function Vocabulary::determineLinkVisibility in Sitemap 2.0.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Sitemap/Vocabulary.php \Drupal\sitemap\Plugin\Sitemap\Vocabulary::determineLinkVisibility()

Determine whether the link for a term should be displayed.

Parameters

\stdClass $term:

Return value

boolean

1 call to Vocabulary::determineLinkVisibility()
Vocabulary::buildSitemapTerm in src/Plugin/Sitemap/Vocabulary.php
Builds a taxonomy term item.

File

src/Plugin/Sitemap/Vocabulary.php, line 411

Class

Vocabulary
Provides a sitemap for an taxonomy vocabulary.

Namespace

Drupal\sitemap\Plugin\Sitemap

Code

protected function determineLinkVisibility($term) {
  if ($this->settings['always_link']) {
    return TRUE;
  }
  elseif ($this->settings['term_count_threshold'] == Vocabulary::THRESHOLD_DISABLED && $term->count) {
    return TRUE;
  }
  elseif ($this->settings['term_count_threshold'] && $term->count >= $this->settings['term_count_threshold']) {
    return TRUE;
  }
  return FALSE;
}