Filters the Pinterest share URL used in sharing button output.
Parameters
- $url
string Pinterest share URL.
Changelog
- Introduced in Jetpack 3.6.0
How to use this hook
Notes
You can use this filter to customize the Pinterest sharing URL. You could, for example, allow Pinterest to select just about any image on the page instead of picking the post’s Featured Image:
function jeherve_multiple_images_pinterest( $url ) {
global $post;
if ( ! $post ) {
return $url;
}
$url = '//www.pinterest.com/pin/create/button/?url=' . rawurlencode( get_permalink( $post->ID ) ) . '&description=' . rawurlencode( $post->post_title );
return $url;
}
add_filter( 'jetpack_sharing_pinterest_share_url', 'jeherve_multiple_images_pinterest' );