From b4930314b48c13823cffabd544cb8f6da8451e81 Mon Sep 17 00:00:00 2001 From: vnmedeiros Date: Wed, 9 Mar 2022 10:04:15 -0300 Subject: [PATCH] fix: test if and exists --- src/functions/single-functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/functions/single-functions.php b/src/functions/single-functions.php index 92e7909..3541a44 100644 --- a/src/functions/single-functions.php +++ b/src/functions/single-functions.php @@ -169,10 +169,10 @@ function tainacan_get_adjacent_item_links($thumbnail = null) { //Get the thumnail url of the previous and next post if (function_exists('tainacan_get_adjacent_items') && isset($_GET['pos'])) { if ($adjacent_items['next']) { - $next_thumb = $adjacent_items['next']['thumbnail']['tainacan-small'][0]; + $next_thumb = isset($adjacent_items['next']['thumbnail']['tainacan-small'][0]) ? $adjacent_items['next']['thumbnail']['tainacan-small'][0] : false; } if ($adjacent_items['previous']) { - $previous_thumb = $adjacent_items['previous']['thumbnail']['tainacan-small'][0]; + $previous_thumb = isset($adjacent_items['previous']['thumbnail']['tainacan-small'][0]) ? $adjacent_items['previous']['thumbnail']['tainacan-small'][0] : false; } } else { $previous_thumb = get_the_post_thumbnail_url( get_previous_post(), 'tainacan-small' ); @@ -183,11 +183,13 @@ function tainacan_get_adjacent_item_links($thumbnail = null) { $previous = $previous_link_url === false ? '' : ''; $next = $next_link_url === false ? '' : ''; break;