From f130d9770944f5023920ae226d85a76ed8f0f28e Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Tue, 16 Aug 2022 11:08:05 -0300 Subject: [PATCH] Fixes gallery block not displaying item thumbnail for document. --- src/classes/theme-helper/class-tainacan-theme-helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classes/theme-helper/class-tainacan-theme-helper.php b/src/classes/theme-helper/class-tainacan-theme-helper.php index 228c5ce7c..2767607b1 100644 --- a/src/classes/theme-helper/class-tainacan-theme-helper.php +++ b/src/classes/theme-helper/class-tainacan-theme-helper.php @@ -1393,9 +1393,10 @@ class Theme_Helper { if ( $media_sources['document'] && !empty(tainacan_get_the_document($item_id)) ) { $is_document_type_attachment = tainacan_get_the_document_type($item_id) === 'attachment'; + $media_items_thumbnails[] = tainacan_get_the_media_component_slide(array( - 'media_content' => get_the_post_thumbnail(null, 'tainacan-medium'), + 'media_content' => get_the_post_thumbnail($item_id, 'tainacan-medium'), 'media_content_full' => $open_lightbox_on_click ? ($is_document_type_attachment ? tainacan_get_the_document($item_id, 'full') : sprintf('
%s
', tainacan_get_the_document($item_id, 'full')) ) : '', 'media_title' => $is_document_type_attachment ? get_the_title(tainacan_get_the_document_raw($item_id)) : '', 'media_description' => $is_document_type_attachment ? get_the_content(null, false, tainacan_get_the_document_raw($item_id)) : '',