From 98ade2996df59bd5c0726242fc312843c758e4ce Mon Sep 17 00:00:00 2001 From: Bhargav Date: Wed, 31 May 2017 12:36:42 +0530 Subject: [PATCH 1/2] twitter creator --- src/Quintype/Seo/Story.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Quintype/Seo/Story.php b/src/Quintype/Seo/Story.php index 537ae53..d95b595 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 'creator'; + } + } + 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']; } } From d77b1958e3197410ca5b6dff8b60722aab2f6889 Mon Sep 17 00:00:00 2001 From: Bhargav Date: Wed, 31 May 2017 14:16:13 +0530 Subject: [PATCH 2/2] creator function change --- src/Quintype/Seo/Story.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Quintype/Seo/Story.php b/src/Quintype/Seo/Story.php index d95b595..40082df 100644 --- a/src/Quintype/Seo/Story.php +++ b/src/Quintype/Seo/Story.php @@ -103,7 +103,7 @@ private function getTwitterAttributes() 'description' => trim($this->getDescription()), 'card' => 'summary_large_image', 'site' => $this->getTwitterSite(), - 'creator' => '@'.$this->getTwitterCreator(), + 'creator' => $this->getTwitterCreator(), 'image' => [ 'src' => $this->getHeroImageUrl(), ], @@ -131,9 +131,9 @@ private function getTwitterCreator() 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]; + return '@'.$creator[3]; } else { - return 'creator'; + return ''; } }