We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2ead80 commit d374ae2Copy full SHA for d374ae2
1 file changed
php/class-delivery.php
@@ -765,11 +765,17 @@ protected function setup_hooks() {
765
*/
766
public function dns_prefetch( $urls, $relation_type ) {
767
768
- $relation_type = apply_filters('cld_dns_prefetch', $relation_type);
+ /**
769
+ * Filter to provide option to omit prefetch.
770
+ *
771
+ * @hook cloudinary_dns_prefetch_types
772
773
+ */
774
+ $resource_hints = apply_filters( 'cloudinary_dns_prefetch_types', array ( 'dns-prefetch', 'preconnect' ) );
775
- if ( 'dns-prefetch' === $relation_type || 'preconnect' === $relation_type ) {
- $urls[] = $this->media->base_url;
- }
776
+ if ( in_array( $relation_type, $resource_hints, true ) {
777
+ $urls[] = $this->media->base_url;
778
+ }
779
780
return $urls;
781
}
0 commit comments