public static function dns_prefetch($new_urls = null)
{
static $prefetch_urls = array();
if (empty($new_urls) && !empty($prefetch_urls)) {
echo "\r\n";
foreach ($prefetch_urls as $this_prefetch_url) {
printf("<link rel='dns-prefetch' href='%s'>\r\n", esc_attr($this_prefetch_url));
}
} elseif (!empty($new_urls)) {
if (!has_action('wp_head', array(__CLASS__, __FUNCTION__))) {
add_action('wp_head', array(__CLASS__, __FUNCTION__));
}
foreach ((array) $new_urls as $this_new_url) {
$prefetch_urls[] = strtolower(untrailingslashit(preg_replace('#^https?://#i', '//', $this_new_url)));
}
$prefetch_urls = array_unique($prefetch_urls);
}
}