You are here

function page_title_user_insert in Page Title 7

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

Implement hook_user_insert().

File

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

Code

function page_title_user_insert(&$edit, &$account, $category) {
  if (user_access('set page title') && isset($edit['page_title']) && drupal_strlen(trim($edit['page_title'])) > 0) {
    db_insert('page_title')
      ->fields(array(
      'type' => 'user',
      'id' => $account->uid,
      'page_title' => $edit['page_title'],
    ))
      ->execute();
  }
}