Opened 7 months ago
Closed 7 months ago
#1591 closed defect (worksforme)
Custom Sharing Doesn't Produce The Correct Link
| Reported by: | edent | Owned by: | mdawaffe |
|---|---|---|---|
| Priority: | normal | Component: | jetpack |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I've added a custom link. The title and icon appear, but the URL is
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 Changed 7 months ago by mdawaffe
- 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".