diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index 5b7de8ef4..d288927a7 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -189,9 +189,9 @@ public function sync( $attachment_id ) { switch ( $this->settings['offload'] ) { case 'cld': $this->remove_local_assets( $attachment_id ); - $url = $this->media->cloudinary_url( $attachment_id, false ); - $url = remove_query_arg( '_i', $url ); - update_post_meta( $attachment_id, '_wp_attached_file', $url ); + $cloudinary_url = $this->media->cloudinary_url( $attachment_id, false ); + $cloudinary_url = remove_query_arg( '_i', $cloudinary_url ); + update_post_meta( $attachment_id, '_wp_attached_file', $cloudinary_url ); break; case 'dual_low': $transformations = $this->media->get_transformation_from_meta( $attachment_id ); @@ -222,6 +222,7 @@ public function sync( $attachment_id ) { $this->remove_local_assets( $attachment_id ); } $date = get_post_datetime( $attachment_id ); + $url = remove_query_arg( '_i', $url ); $this->download->download_asset( $attachment_id, $url, $date->format( 'Y/m' ) ); }