Skip to content

Commit 9e279ba

Browse files
Merge pull request #1039 from cloudinary/fix/system-report-media-sync-size
Ensure the storage is setup when using the size_sync outside of the class
2 parents ca4ef29 + 0c36e19 commit 9e279ba

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

php/sync/class-storage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ public function size_signature( $attachment_id ) {
389389
* @param string $public_id Optional public ID.
390390
*/
391391
public function size_sync( $attachment_id, $public_id = null ) {
392+
if ( empty( $this->media ) ) {
393+
$this->setup();
394+
}
395+
392396
if ( is_null( $public_id ) ) {
393397
$public_id = $this->media->get_public_id( $attachment_id );
394398
}

0 commit comments

Comments
 (0)