You are here

public static function ShareaholicPublic::insert_dns_snippet in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 public.php \ShareaholicPublic::insert_dns_snippet()

Inserts dns-prefetch tags on the page

1 call to ShareaholicPublic::insert_dns_snippet()
shareaholic_init in ./shareaholic.module
Implements hook_init() This gets called at the beginning of a non-cached page request Ideal for setting response headers

File

./public.php, line 86

Class

ShareaholicPublic
This class is all about drawing the stuff in publishers' templates that visitors can see.

Code

public static function insert_dns_snippet() {
  $dns_snippet = <<<DOC
<link rel='dns-prefetch' href='//k4z6w9b5.stackpathcdn.com' />
<link rel='dns-prefetch' href='//cdn.shareaholic.net' />
<link rel='dns-prefetch' href='//www.shareaholic.net' />
<link rel='dns-prefetch' href='//analytics.shareaholic.com' />
<link rel='dns-prefetch' href='//recs.shareaholic.com' />
<link rel='dns-prefetch' href='//go.shareaholic.com' />
<link rel='dns-prefetch' href='//partner.shareaholic.com' />
DOC;
  $element = array(
    '#type' => 'markup',
    '#markup' => $dns_snippet,
  );
  drupal_add_html_head($element, 'shareaholic_dns_snippet');
}