function taxonomy_term_is_page in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/taxonomy/taxonomy.module \taxonomy_term_is_page()
Returns whether the current page is the page of the passed-in term.
Parameters
\Drupal\taxonomy\Entity\Term $term: A taxonomy term entity.
1 call to taxonomy_term_is_page()
- template_preprocess_taxonomy_term in core/
modules/ taxonomy/ taxonomy.module - Prepares variables for taxonomy term templates.
File
- core/
modules/ taxonomy/ taxonomy.module, line 266 - Enables the organization of content into categories.
Code
function taxonomy_term_is_page(Term $term) {
if (\Drupal::routeMatch()
->getRouteName() == 'entity.taxonomy_term.canonical' && ($page_term_id = \Drupal::routeMatch()
->getRawParameter('taxonomy_term'))) {
return $page_term_id == $term
->id();
}
return FALSE;
}