We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 931893b + d374ae2 commit ba0bc2bCopy full SHA for ba0bc2b
php/class-delivery.php
@@ -725,9 +725,17 @@ protected function setup_hooks() {
725
*/
726
public function dns_prefetch( $urls, $relation_type ) {
727
728
- if ( 'dns-prefetch' === $relation_type || 'preconnect' === $relation_type ) {
729
- $urls[] = $this->media->base_url;
730
- }
+ /**
+ * Filter to provide option to omit prefetch.
+ *
731
+ * @hook cloudinary_dns_prefetch_types
732
733
+ */
734
+ $resource_hints = apply_filters( 'cloudinary_dns_prefetch_types', array ( 'dns-prefetch', 'preconnect' ) );
735
+
736
+ if ( in_array( $relation_type, $resource_hints, true ) {
737
+ $urls[] = $this->media->base_url;
738
+ }
739
740
return $urls;
741
}
0 commit comments