@@ 778-787 (lines=10) @@ | ||
775 | } |
|
776 | } |
|
777 | ||
778 | public function process_request( $post, array $post_data ) { |
|
779 | $reddit_url = $this->http() . '://reddit.com/submit?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&title=' . rawurlencode( $this->get_share_title( $post->ID ) ); |
|
780 | ||
781 | // Record stats |
|
782 | parent::process_request( $post, $post_data ); |
|
783 | ||
784 | // Redirect to Reddit |
|
785 | wp_redirect( $reddit_url ); |
|
786 | die(); |
|
787 | } |
|
788 | } |
|
789 | ||
790 | class Share_LinkedIn extends Sharing_Source { |
|
@@ 956-965 (lines=10) @@ | ||
953 | return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Facebook', 'share to', 'jetpack' ), __( 'Click to share on Facebook', 'jetpack' ), 'share=facebook', 'sharing-facebook-' . $post->ID ); |
|
954 | } |
|
955 | ||
956 | public function process_request( $post, array $post_data ) { |
|
957 | $fb_url = $this->http() . '://www.facebook.com/sharer.php?u=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&t=' . rawurlencode( $this->get_share_title( $post->ID ) ); |
|
958 | ||
959 | // Record stats |
|
960 | parent::process_request( $post, $post_data ); |
|
961 | ||
962 | // Redirect to Facebook |
|
963 | wp_redirect( $fb_url ); |
|
964 | die(); |
|
965 | } |
|
966 | ||
967 | public function display_footer() { |
|
968 | $this->js_dialog( $this->shortname ); |
|
@@ 1429-1437 (lines=9) @@ | ||
1426 | } |
|
1427 | } |
|
1428 | ||
1429 | public function process_request( $post, array $post_data ) { |
|
1430 | // Record stats |
|
1431 | parent::process_request( $post, $post_data ); |
|
1432 | ||
1433 | // Redirect to Tumblr's sharing endpoint (a la their bookmarklet) |
|
1434 | $url = 'https://www.tumblr.com/share?v=3&u=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&t=' . rawurlencode( $this->get_share_title( $post->ID ) ) . '&s='; |
|
1435 | wp_redirect( $url ); |
|
1436 | die(); |
|
1437 | } |
|
1438 | // http://www.tumblr.com/share?v=3&u=URL&t=TITLE&s= |
|
1439 | public function display_footer() { |
|
1440 | if ( $this->smart ) { |
|
@@ 1618-1625 (lines=8) @@ | ||
1615 | return __( 'Pocket', 'jetpack' ); |
|
1616 | } |
|
1617 | ||
1618 | public function process_request( $post, array $post_data ) { |
|
1619 | // Record stats |
|
1620 | parent::process_request( $post, $post_data ); |
|
1621 | ||
1622 | $pocket_url = esc_url_raw( 'https://getpocket.com/save/?url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&title=' . rawurlencode( $this->get_share_title( $post->ID ) ) ); |
|
1623 | wp_redirect( $pocket_url ); |
|
1624 | exit; |
|
1625 | } |
|
1626 | ||
1627 | public function get_display( $post ) { |
|
1628 | if ( $this->smart ) { |
|
@@ 1673-1680 (lines=8) @@ | ||
1670 | public function get_name() { |
|
1671 | return __( 'Telegram', 'jetpack' ); |
|
1672 | } |
|
1673 | public function process_request( $post, array $post_data ) { |
|
1674 | // Record stats |
|
1675 | parent::process_request( $post, $post_data ); |
|
1676 | $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 ) ) ); |
|
1677 | wp_redirect( $telegram_url ); |
|
1678 | exit; |
|
1679 | } |
|
1680 | ||
1681 | public function get_display( $post ) { |
|
1682 | return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Telegram', 'share to', 'jetpack' ), __( 'Click to share on Telegram', 'jetpack' ), 'share=telegram' ); |
|
1683 | } |