Share_Telegram

The WordPress Core Share Telegram class.

Defined (1)

The class is defined in the following location(s).

/modules/sharedaddy/sharing-sources.php  
  1. class Share_Telegram extends Sharing_Source { 
  2. public $shortname = 'telegram'; 
  3.  
  4. public function __construct( $id, array $settings ) { 
  5. parent::__construct( $id, $settings ); 
  6.  
  7. public function get_name() { 
  8. return __( 'Telegram', 'jetpack' ); 
  9. public function process_request( $post, array $post_data ) { 
  10. // Record stats 
  11. parent::process_request( $post, $post_data ); 
  12. $telegram_url = esc_url_raw( 'https://telegram.me/share/url?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&text=' . rawurlencode( $this->get_share_title( $post->ID ) ) ); 
  13. wp_redirect( $telegram_url ); 
  14. exit; 
  15.  
  16. public function get_display( $post ) { 
  17. return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Telegram', 'share to', 'jetpack' ), __( 'Click to share on Telegram', 'jetpack' ), 'share=telegram' ); 
  18.  
  19. function display_footer() { 
  20. $this->js_dialog( $this->shortname, array( 'width' => 450, 'height' => 450 ) );