Skip to content

Commit

Permalink
twitter creator
Browse files Browse the repository at this point in the history
  • Loading branch information
rssbhargaw committed May 31, 2017
1 parent 3d6e862 commit 98ade29
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 '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'];
}
}
Expand Down

0 comments on commit 98ade29

Please sign in to comment.