Skip to content

Instantly share code, notes, and snippets.

@dededey
Last active August 29, 2015 14:20
Show Gist options
  • Save dededey/5b8777d00429516ec4fb to your computer and use it in GitHub Desktop.
Save dededey/5b8777d00429516ec4fb to your computer and use it in GitHub Desktop.
socials share in functions
// facebook share
function fbShare($url,$picture = 'http://www.sito.com/wp-content/uploads/foto-default.jpg' , $title = 'sito.com', $desc = 'descritpion'){
// return "https://www.facebook.com/dialog/share?app_id=422399111266789&display=popup&href=".$url."&redirect_uri=".$url;
return "https://www.facebook.com/dialog/feed?app_id=422399111266789&link=".$url."&picture=".$picture."&name=".$title."&description=".$desc."&redirect_uri=http://www.thewinterview.com";
}
// twitter share
function twitterShare($url,$frase = NULL){
return 'https://twitter.com/share?url='.$url.'&text='.$frase;
}
// pinterest share
function pinterestShare($url,$img_url,$description){
$encoded_desc = urlencode($description);
return 'http://pinterest.com/pin/create/button/?url='.$url.'&media='.$img_url.'&description='.$encoded_desc.'" class="pin-it-button" count-layout="horizontal"';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment