Skip to content

Commit a0bc246

Browse files
author
Marco Pereirinha
committed
Ensure that attachment_metadata is created and updated
1 parent 218ce8d commit a0bc246

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

php/sync/class-download-sync.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ public function download_asset( $attachment_id, $source = null, $date = null ) {
174174

175175
// Prepare the asset.
176176
update_attached_file( $attachment_id, $upload['file'] );
177-
wp_generate_attachment_metadata( $attachment_id, $upload['file'] );
177+
178+
wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $upload['file'] ) );
178179

179180
// Update the folder synced flag.
180181
$public_id = $this->media->get_public_id( $attachment_id );

0 commit comments

Comments
 (0)