Skip to content

Commit

Permalink
Sharing: remove Reddit's official sharing button (#31666)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Jul 3, 2023
1 parent cb64b3d commit 6749c9f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Sharing: remove Reddit's Oofficial iFramed sharing button, it is no longer working. Use icon+text sharing button instead.
11 changes: 0 additions & 11 deletions projects/plugins/jetpack/modules/sharedaddy/admin-sharing.css
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,6 @@ body.settings_page_sharing .advanced input[type=submit] {
margin-top: 2px;
}

.preview-reddit .option-smart-on {
background: url(images/smart-reddit.png) no-repeat top left;
background-size: 104px 21px;
width:104px;
height:21px;
}

.preview-facebook .option-smart-on {
background: url(images/smart-like.png) no-repeat top left;
background-size: 85px 20px;
Expand Down Expand Up @@ -380,10 +373,6 @@ body.settings_page_sharing .advanced input[type=submit] {
background-image: url(images/smart-digg@2x.png);
}

.preview-reddit .option-smart-on {
background-image: url(images/smart-reddit@2x.png);
}

.preview-facebook .option-smart-on {
background-image: url(images/smart-like@2x.png);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
! $( this ).hasClass( 'preview-mastodon' ) &&
! $( this ).hasClass( 'preview-nextdoor' ) &&
! $( this ).hasClass( 'preview-print' ) &&
! $( this ).hasClass( 'preview-reddit' ) &&
! $( this ).hasClass( 'preview-telegram' ) &&
! $( this ).hasClass( 'preview-jetpack-whatsapp' ) &&
! $( this ).hasClass( 'share-custom' ) &&
Expand Down
Binary file not shown.
Binary file not shown.
27 changes: 6 additions & 21 deletions projects/plugins/jetpack/modules/sharedaddy/sharing-sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -1335,22 +1335,6 @@ class Share_Reddit extends Sharing_Source {
*/
public $icon = '\f222';

/**
* Constructor.
*
* @param int $id Sharing source ID.
* @param array $settings Sharing settings.
*/
public function __construct( $id, array $settings ) {
parent::__construct( $id, $settings );

if ( 'official' === $this->button_style ) {
$this->smart = true;
} else {
$this->smart = false;
}
}

/**
* Service name.
*
Expand All @@ -1368,11 +1352,12 @@ public function get_name() {
* @return string
*/
public function get_display( $post ) {
if ( $this->smart ) {
return '<div class="reddit_button"><iframe src="' . $this->http() . '://www.reddit.com/static/button/button1.html?newwindow=true&width=120&amp;url=' . rawurlencode( $this->get_share_url( $post->ID ) ) . '&amp;title=' . rawurlencode( $this->get_share_title( $post->ID ) ) . '" height="22" width="120" scrolling="no" frameborder="0"></iframe></div>';
} else {
return $this->get_link( $this->get_process_request_url( $post->ID ), _x( 'Reddit', 'share to', 'jetpack' ), __( 'Click to share on Reddit', 'jetpack' ), 'share=reddit' );
}
return $this->get_link(
$this->get_process_request_url( $post->ID ),
_x( 'Reddit', 'share to', 'jetpack' ),
__( 'Click to share on Reddit', 'jetpack' ),
'share=reddit'
);
}

/**
Expand Down
7 changes: 2 additions & 5 deletions projects/plugins/jetpack/modules/sharedaddy/sharing.css
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ body .sd-content ul li.share-custom.no-icon a span {
.sd-social-icon .sd-content ul li.share-reddit a:before,
.sd-social-text .sd-content ul li.share-reddit a:before,
.sd-content ul li.share-reddit div.option.option-smart-off a:before,
.sd-social-icon-text .sd-content li.share-reddit a:before {
.sd-social-icon-text .sd-content li.share-reddit a:before,
.sd-social-official .sd-content li.share-reddit a:before {
content: '\f222';
}
.sd-social-icon .sd-content ul li.share-tumblr a:before,
Expand Down Expand Up @@ -453,10 +454,6 @@ body .sd-content ul li.share-custom.no-icon a span {


/* Individual official buttons */
.reddit_button iframe {
margin-top: 1px;
}

.pocket_button iframe, .pinterest_button, .twitter_button, .linkedin_button>span {
margin: 0 !important;
}
Expand Down

0 comments on commit 6749c9f

Please sign in to comment.