Skip to content

Commit

Permalink
Merge pull request #3 from rssbhargaw/twitter-creator
Browse files Browse the repository at this point in the history
twitter creator
  • Loading branch information
anagh-p authored May 31, 2017
2 parents e3de3a7 + d77b195 commit 82d9d6b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Quintype/Seo/Story.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
],
Expand All @@ -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'];
}
}
Expand Down

0 comments on commit 82d9d6b

Please sign in to comment.