WordPress.org

Plugin Directory

jetpack

#1591 closed defect (worksforme)

Custom Sharing Doesn't Produce The Correct Link

Reported by: edent Owned by: mdawaffe
Priority: normal Severity: normal
Plugin: jetpack Keywords:
Cc:

Description

I've added a custom link. The title and icon appear, but the URL is

http://[posturl]/?share=custom-1350037116&nb=1

The issue appears to be at
http://plugins.trac.wordpress.org/browser/jetpack/trunk/modules/sharedaddy/sharing-sources.php#L926

At the moment, it's:

$str = $this->get_link( get_permalink( $post->ID ), esc_html( $this->name ), ( 'Click to share', 'jetpack' ), 'share='.$this->id );

It should be doing something like:
$url = str_replace( '&', '&', $this->url );

$url = str_replace( '%post_url%', rawurlencode( $this->get_share_url( $post->ID ) ), $url );
$url = str_replace( '%post_full_url%', rawurlencode( get_permalink( $post->ID ) ), $url );
$url = str_replace( '%post_title%', rawurlencode( $post->post_title ), $url );
$str = $this->get_link( $url, esc_html( $this->name ), ( 'Click to share', 'jetpack' ), 'share='.$this->id );

Change History (1)

comment:1 mdawaffe18 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

Everything works for me.

Make sure you're using %post_url% instead of [posturl] in your Custom Service's "Sharing URL".

Note: See TracTickets for help on using tickets.