Skip to content

Commit 7af3814

Browse files
authored
Merge pull request #479 from cloudinary/fix/storage-sync
Fix storage sync
2 parents a27a05c + fa58ae3 commit 7af3814

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

php/sync/class-storage.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ public function sync( $attachment_id ) {
189189
switch ( $this->settings['offload'] ) {
190190
case 'cld':
191191
$this->remove_local_assets( $attachment_id );
192-
$url = $this->media->cloudinary_url( $attachment_id, false );
193-
$url = remove_query_arg( '_i', $url );
194-
update_post_meta( $attachment_id, '_wp_attached_file', $url );
192+
$cloudinary_url = $this->media->cloudinary_url( $attachment_id, false );
193+
$cloudinary_url = remove_query_arg( '_i', $cloudinary_url );
194+
update_post_meta( $attachment_id, '_wp_attached_file', $cloudinary_url );
195195
break;
196196
case 'dual_low':
197197
$transformations = $this->media->get_transformation_from_meta( $attachment_id );
@@ -222,6 +222,7 @@ public function sync( $attachment_id ) {
222222
$this->remove_local_assets( $attachment_id );
223223
}
224224
$date = get_post_datetime( $attachment_id );
225+
$url = remove_query_arg( '_i', $url );
225226
$this->download->download_asset( $attachment_id, $url, $date->format( 'Y/m' ) );
226227
}
227228

0 commit comments

Comments
 (0)