You are here

function page_title_node_insert in Page Title 8.2

Same name and namespace in other branches
  1. 7.2 page_title.module \page_title_node_insert()
  2. 7 page_title.module \page_title_node_insert()

Implement hook_node_insert().

File

./page_title.module, line 394
Enhanced control over the page title (in the head tag).

Code

function page_title_node_insert($node) {
  if (user_access('set page title') && isset($node->page_title) && drupal_strlen(trim($node->page_title)) > 0) {
    db_insert('page_title')
      ->fields(array(
      'type' => 'node',
      'id' => $node->nid,
      'page_title' => $node->page_title,
    ))
      ->execute();
  }
}