Skip to content

Commit f44bd1a

Browse files
authored
Merge pull request #985 from cloudinary/fix/pdf-embeds
Do not add the analytics argument on admin ajax requests
2 parents 2b2e773 + 192879d commit f44bd1a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

php/class-media.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,13 @@ public function cloudinary_url( $attachment_id, $size = array(), $transformation
14281428
*/
14291429
$url = apply_filters( 'cloudinary_converted_url', $url, $attachment_id, $pre_args );
14301430

1431+
// Early bail for admin AJAX requests.
1432+
if ( defined( 'DOING_AJAX' ) && DOING_AJAX && is_admin() ) {
1433+
$cache[ $key ] = $url;
1434+
1435+
return $cache[ $key ];
1436+
}
1437+
14311438
// Add Cloudinary analytics.
14321439
$cache[ $key ] = add_query_arg(
14331440
array(

0 commit comments

Comments
 (0)