From 1a0db28d2ea3158c6efdc66cffd35bf1d7d17c42 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Sep 2020 19:02:40 +0000 Subject: [PATCH] Only display redundant preview data with preview picture --- src/Content/PageInfo.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Content/PageInfo.php b/src/Content/PageInfo.php index e4d9207c8c..d301c4d04d 100644 --- a/src/Content/PageInfo.php +++ b/src/Content/PageInfo.php @@ -134,14 +134,6 @@ class PageInfo $text = "[attachment type='" . $data['type'] . "'"; - if (empty($data['text'])) { - $data['text'] = $data['title']; - } - - if (empty($data['text'])) { - $data['text'] = $data['url']; - } - if (!empty($data['url'])) { $text .= " url='" . $data['url'] . "'"; } @@ -160,6 +152,14 @@ class PageInfo $text .= " image='" . $preview . "'"; } else { $text .= " preview='" . $preview . "'"; + + if (empty($data['text'])) { + $data['text'] = $data['title']; + } + + if (empty($data['text'])) { + $data['text'] = $data['url']; + } } }