diff --git a/src/Quintype/Seo/Story.php b/src/Quintype/Seo/Story.php index 537ae53..40082df 100644 --- a/src/Quintype/Seo/Story.php +++ b/src/Quintype/Seo/Story.php @@ -103,6 +103,7 @@ private function getTwitterAttributes() 'description' => trim($this->getDescription()), 'card' => 'summary_large_image', 'site' => $this->getTwitterSite(), + 'creator' => $this->getTwitterCreator(), 'image' => [ 'src' => $this->getHeroImageUrl(), ], @@ -124,9 +125,21 @@ private function getTwitterSite() } } + private function getTwitterCreator() + { + $creator = []; + if ((isset($this->config['social-links']['twitter-url']))&&($this->config['social-links']['twitter-url'] !="")) { + $creator = $this->config['social-links']['twitter-url']; + $creator = explode('/', $creator); + return '@'.$creator[3]; + } else { + return ''; + } + } + private function getPublisher() { - if (isset($this->config['social-links'])) { + if ((isset($this->config['social-links']['facebook-url']))&&($this->config['social-links']['facebook-url'] !="")) { return $this->config['social-links']['facebook-url']; } }