Created
May 23, 2016 17:55
-
-
Save josephhinson/55fa523514de335f1566873be6aaf447 to your computer and use it in GitHub Desktop.
These are some useful function for extending the jetpack sharing features.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Twitter @username to Jetpack Sharing | |
// from http://wpspeak.com/adding-twitter-handle/ | |
function custom_add_twitterhandle_via() { | |
return 'username'; | |
} | |
add_filter ( 'jetpack_sharing_twitter_via', 'custom_add_twitterhandle_via' ); | |
// This function adds a colon after the title of the twitter share | |
function custom_sharing_title() { | |
$post = get_post(); | |
if ( empty( $post ) ) { | |
return; | |
} else { | |
// Create sharing title | |
$sharing_title = get_the_title( $post->ID ); | |
return $sharing_title .':'; | |
} | |
} | |
add_filter( 'sharing_title', 'custom_sharing_title', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment