You are here

function word_link_get_node_type in Word Link 7.2

Gets node type by nid.

Parameters

int $nid: Node's nid.

Return value

string Node's type.

1 call to word_link_get_node_type()
word_link_convert_text in ./word_link.module
Find and convert defined word to link.

File

./word_link.module, line 522

Code

function word_link_get_node_type($nid) {
  $type =& drupal_static(__FUNCTION__ . '_' . $nid);
  if (!isset($type)) {
    $query = db_select('node', 'n')
      ->fields('n', array(
      'type',
    ))
      ->condition('n.nid', $nid);
    $type = $query
      ->execute()
      ->fetchField();
  }
  return $type;
}