tutor icon indicating copy to clipboard operation
tutor copied to clipboard

Telegram sharing button

Open 360fun opened this issue 5 years ago • 1 comments

Please add Telegram to social sharing buttons 🙏

https://t.me/share/url?url={url}&text={text}

/**
 * @param string $url Absolute URL to share, e.g. "https://example.com/path/to/article?with=params"
 * @param string $text Optional comment to share URL with, e.g. "Check out this article!"
 * @return string Button HTML markup, feel free to modify to your taste
 */
function telegramForwardButton($url, $text = '') {
  $share_url = 'https://t.me/share/url?url='.rawurlencode($url).'&text='.rawurlencode($text);
  return "<a href=\"{$share_url}\">Share</a>";
}

https://core.telegram.org/widgets/share

360fun avatar Jun 17 '20 01:06 360fun

+1

tomrobak avatar Nov 08 '21 11:11 tomrobak