diff --git a/src/classes/theme-helper/template-tags.php b/src/classes/theme-helper/template-tags.php index a80cda8bd..2e2d3dc6f 100644 --- a/src/classes/theme-helper/template-tags.php +++ b/src/classes/theme-helper/template-tags.php @@ -996,9 +996,11 @@ function tainacan_get_the_mime_type_icon($mime_type, $image_size = 'medium') { $icon_file = 'placeholder_pdf'; break; case 'attachment': + $icon_file = 'placeholder_attachment'; + break; case 'empty': default: - $icon_file = 'placeholder_attachment'; + $icon_file = 'placeholder_square'; } return $images_path . $icon_file . $image_size . '.png'; diff --git a/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php b/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php index db9dc2ecc..ee2edf3dc 100644 --- a/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php +++ b/src/views/admin/components/metadata-types/relationship/class-tainacan-relationship.php @@ -238,7 +238,7 @@ class Relationship extends Metadata_Type { if ( $item_meta instanceof \Tainacan\Entities\Item_Metadata_Entity && $item_meta->get_value_as_html() != '' ) { $meta_id = $item_meta->get_metadatum()->get_id(); $as_header = $search_meta_id == $meta_id ? $this->get_item_link($item, $search_meta_id) : false; - $html = $this->get_meta_html($item_meta, $as_header, $thumbnail_id); + $html = $this->get_meta_html($item_meta, $item, $as_header, $thumbnail_id); if($as_header === false) { $metadata_value[] = $html; } else { @@ -275,14 +275,23 @@ class Relationship extends Metadata_Type { return $return; } - private function get_meta_html(\Tainacan\Entities\Item_Metadata_Entity $meta, $value_link = false, $thumbnail_id = false) { + private function get_item_thumbnail($thumbnail_id, $item) { + if($thumbnail_id !== false && !empty($thumbnail_id)){ + return \wp_get_attachment_image($thumbnail_id, 'tainacan-small'); + } + $media_type = $item->get_document_mimetype(); + $placeholder_image = ''; + return $placeholder_image; + } + + private function get_meta_html(\Tainacan\Entities\Item_Metadata_Entity $meta, \Tainacan\Entities\Item $item, $value_link = false, $thumbnail_id = false) { $html = ''; if ($meta instanceof \Tainacan\Entities\Item_Metadata_Entity && !empty($meta->get_value_as_html())) { ob_start(); if ($value_link) { ?>