Skip to content

Instantly share code, notes, and snippets.

@jeherve
jeherve / plugin.php
Last active February 7, 2017 02:00
[Jetpack] Add tracking parameters to a post URL, and then have that tracked URL shortened by goo.gl, and then use that short URL in sharing buttons
<?php
/**
* Overwrite the links used in Jetpack's Sharing module.
*
* @see https://wordpress.org/support/topic/how-to-use-utm-codes-with-jetpack-sharing
*
* @param string $url
* @param int $post_id
* @param int $sharing_id
* @filter sharing_permalink