Skip to content

Commit

Permalink
Add Pinterest as Social helper
Browse files Browse the repository at this point in the history
  • Loading branch information
yclacti committed Jul 16, 2021
1 parent d6b753f commit 8f99625
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Helper/SocialShare/Pinterest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace ActiTimberPackage\Helper\SocialShare;

final class Pinterest extends SocialShareHelper implements SocialShareInterface
{
/**
* Return Facebook share url
*
* @param \WP_Post $post
* @return string url
*/
public function getShareUrl($post)
{
$postUrl = get_permalink($post);
$pinterestUrl = sprintf('http://pinterest.com/pin/create/link/?url=%1$s', $postUrl);

return $pinterestUrl;
}
}

0 comments on commit 8f99625

Please sign in to comment.