This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Alter dns-prefetch links in <head> | |
*/ | |
add_filter('wp_resource_hints', function (array $urls, string $relation): array { | |
// If the relation is different than dns-prefetch, leave the URLs intact | |
if ($relation !== 'dns-prefetch') { | |
return $urls; | |
} |