Skip to content

Commit 0c36e19

Browse files
committed
Ensure the storage is setup when using the size_sync outside of the class
1 parent 4d36b34 commit 0c36e19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)