Skip to content

Commit ac0d903

Browse files
author
Marco Pereirinha
committed
Ensure that there is a sized_url. PDFs won\´t have it, so use attachment url instead
1 parent 952f08d commit ac0d903

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

php/class-delivery.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,9 @@ public function find_attachment_size_urls() {
870870
if ( true === $auto_sync ) {
871871
$this->sync->add_to_sync( $result->post_id );
872872
}
873-
$size = $this->get_sized( $result->post_id );
874-
$cached[ $size['sized_url'] ] = (int) $result->post_id;
873+
$size = $this->get_sized( $result->post_id );
874+
$key = ! empty( $size['sized_url'] ) ? $size['sized_url'] : wp_get_attachment_url( $result->post_id );
875+
$cached[ $key ] = (int) $result->post_id;
875876
}
876877
}
877878
wp_cache_add( $key, $cached );

0 commit comments

Comments
 (0)