You are here

function nat_get_term in Node Auto Term [NAT] 7.2

Same name and namespace in other branches
  1. 5 nat.module \nat_get_term()
  2. 6.2 nat.module \nat_get_term()
  3. 6 nat.module \nat_get_term()
  4. 7 nat.module \nat_get_term()

Retrieve the first / single NAT term associated with a node optionally restricted by vocabulary.

Parameters

$nid: The node ID of the node whose NAT-term is to be retrieved.

$vocabularies: An optional array of vocabulary IDs used to optionally retrict the retrieved term to a defined set of vocabularies.

1 call to nat_get_term()
nat_handler_argument_term_node_tid_depth::query in includes/nat_handler_argument_term_node_tid_depth.inc
Set up the query for this argument.

File

./nat.module, line 376
NAT - node auto term - is a helper module that automatically creates a term using the same title as a node.

Code

function nat_get_term($nid, $vocabularies = array()) {
  $terms = empty($vocabularies) ? nat_get_terms($nid) : nat_get_terms_by_vocabulary($nid, $vocabularies);
  return array_shift($terms);
}