Add link preview description for blog posts

This commit is contained in:
grandeljay 2022-06-09 06:56:58 +02:00
parent 390915a884
commit 935a7e9e76
2 changed files with 4 additions and 2 deletions

View file

@ -102,6 +102,7 @@ class Page
public string $language = DEFAULT_LOCALE; public string $language = DEFAULT_LOCALE;
public array $messages = array(); public array $messages = array();
public string $link_preview; public string $link_preview;
public string $description;
/** /**
* __construct * __construct

View file

@ -17,6 +17,7 @@ $page = new Page(__FILE__, $post->title->rendered);
if (isset($postMedia->source_url)) { if (isset($postMedia->source_url)) {
$page->link_preview = $postMedia->source_url; $page->link_preview = $postMedia->source_url;
$page->description = $post->excerpt->rendered;
} }
$page->header(); $page->header();