You are here

function site_verify_init in Site verification 7.2

Same name and namespace in other branches
  1. 6 site_verify.module \site_verify_init()
  2. 7 site_verify.module \site_verify_init()

Implements hook_init().

@todo Move this to hook_html_head_alter()?

File

./site_verify.module, line 89
Site Verify provides a tool for verification codes (meta tags or custom pages) to be added to the site, for verification with external search engines.

Code

function site_verify_init() {

  // Add the verification meta tags to the front page.
  if (drupal_is_front_page()) {
    $meta_tags = db_query("SELECT svid, meta FROM {site_verify} WHERE meta <> ''")
      ->fetchAllKeyed();
    foreach ($meta_tags as $svid => $meta_tag) {
      $data = array(
        '#type' => 'markup',
        '#markup' => $meta_tag . "\n",
      );
      drupal_add_html_head($data, 'site_verify:' . $svid);
    }
  }
}