| Server IP : 170.10.161.225 / Your IP : 216.73.217.54 Web Server : Apache System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : calvet ( 273824) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : ON Directory : /home/www/calvetrealty.com/wp-content/plugins/wp-rocket/inc/front/ |
Upload File : |
<?php
defined( 'ABSPATH' ) || exit;
/**
* Adds domain names to the list of DNS Prefetch printed by wp_resource_hints
*
* @since 2.8.9
* @author Remy Perona
*
* @param Array $hints URLs to print for resource hints.
* @param String $relation_type The relation type the URL are printed for.
* @return Array URLs to print
*/
function rocket_dns_prefetch( $hints, $relation_type ) {
// Don't add prefetch for uncached pages.
if ( defined( 'DONOTROCKETOPTIMIZE' ) && DONOTROCKETOPTIMIZE ) {
return $hints;
}
$domains = rocket_get_dns_prefetch_domains();
if ( (bool) $domains ) {
foreach ( $domains as $domain ) {
if ( 'dns-prefetch' === $relation_type ) {
$hints[] = $domain;
}
}
}
return $hints;
}
add_filter( 'wp_resource_hints', 'rocket_dns_prefetch', 10, 2 );