You are here

static function TaxoFacets::getTermIdFromUrlAlias in Taxonomy Facets 7.3

Get term id.

For a given taxonomy term name return the term id. @todo deal with duplicate term names, i.e same name in 2 vocabularies.

Parameters

integer $term_name: Taxonomy term name, or rather its clean url interpretation.

Return value

integer Return the term id. return null if no term with this name found.

1 call to TaxoFacets::getTermIdFromUrlAlias()
TaxoFacets::__construct in classes/SelectedFilters.php

File

classes/SelectedFilters.php, line 91

Class

TaxoFacets

Namespace

taxonomyFacets

Code

static function getTermIdFromUrlAlias($term_name) {
  if ($path = drupal_lookup_path('source', $term_name)) {
    $path = explode('/', $path);
    return $path[2];
  }

  // If there were no records, i.e no term with this name, we return null.
  return NULL;
}