Skip to content

Commit a17ab33

Browse files
committed
Add information about the cloudinary_dns_prefetch_types filter
1 parent ba0bc2b commit a17ab33

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

php/class-delivery.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,18 @@ public function dns_prefetch( $urls, $relation_type ) {
729729
* Filter to provide option to omit prefetch.
730730
*
731731
* @hook cloudinary_dns_prefetch_types
732-
*
732+
* @since 3.2.12
733+
* @default array ( 'dns-prefetch', 'preconnect' )
734+
*
735+
* @param $types {array} The types of resource hints to use.
736+
*
737+
* @return {array} The modified resource hints to use.
733738
*/
734-
$resource_hints = apply_filters( 'cloudinary_dns_prefetch_types', array ( 'dns-prefetch', 'preconnect' ) );
739+
$resource_hints = apply_filters( 'cloudinary_dns_prefetch_types', array( 'dns-prefetch', 'preconnect' ) );
735740

736-
if ( in_array( $relation_type, $resource_hints, true ) {
737-
$urls[] = $this->media->base_url;
738-
}
741+
if ( in_array( $relation_type, $resource_hints, true ) ) {
742+
$urls[] = $this->media->base_url;
743+
}
739744

740745
return $urls;
741746
}

0 commit comments

Comments
 (0)