getPost(); return array_merge($params, [ 'type' => $post->getOgType() ?: 'article', 'url' => $this->_helper->getCanonicalUrl($post->getPostUrl()), 'image' => (string)$post->getImageUrl(), ]); } /** * Retrieve current post * * @return \Magefan\Blog\Model\Post */ public function getPost() { return $this->_coreRegistry->registry('current_blog_post'); } /** * Retrieve page main image * * @return string | null */ public function getImage() { $image = $this->getPost()->getOgImage(); if (!$image) { $image = $this->getPost()->getFirstImage(); } if ($image) { return $this->stripTags($image); } } }