From 0c36e19e4fc32048bf847bca32710702b6c78c12 Mon Sep 17 00:00:00 2001 From: Aleksandar Atanasov Date: Fri, 2 May 2025 12:56:44 +0300 Subject: [PATCH] Ensure the storage is setup when using the size_sync outside of the class --- php/sync/class-storage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/sync/class-storage.php b/php/sync/class-storage.php index a3223bb29..55b5a3f1a 100644 --- a/php/sync/class-storage.php +++ b/php/sync/class-storage.php @@ -389,6 +389,10 @@ public function size_signature( $attachment_id ) { * @param string $public_id Optional public ID. */ public function size_sync( $attachment_id, $public_id = null ) { + if ( empty( $this->media ) ) { + $this->setup(); + } + if ( is_null( $public_id ) ) { $public_id = $this->media->get_public_id( $attachment_id ); }