Strip tags from link preview description
This commit is contained in:
parent
935a7e9e76
commit
7f1a54c848
1 changed files with 6 additions and 1 deletions
|
@ -17,7 +17,12 @@ $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;
|
}
|
||||||
|
|
||||||
|
if (isset($post->excerpt->rendered)) {
|
||||||
|
$page->description = substr(strip_tags($post->excerpt->rendered), 0, 256);
|
||||||
|
} else {
|
||||||
|
$page->description = substr(strip_tags($post->content->rendered), 0, 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
$page->header();
|
$page->header();
|
||||||
|
|
Loading…
Reference in a new issue