Add link preview description for blog posts
This commit is contained in:
parent
390915a884
commit
935a7e9e76
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue