Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created May 24, 2018 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/ed5af4d66f823e59d4eceb8a13471134 to your computer and use it in GitHub Desktop.
Save billerickson/ed5af4d66f823e59d4eceb8a13471134 to your computer and use it in GitHub Desktop.
<?php
/**
* Shared Counts - Add username to twitter share
*
* @see https://www.billerickson.net/code/shared-counts-twitter-username
* @author Bill Erickson
*
* @param array $link
* @return array
*/
function be_shared_counts_twitter_username( $link ) {
if( 'twitter' == $link['type'] ) {
$link['link'] .= '&via=billerickson';
}
return $link;
}
add_filter( 'shared_counts_link', 'be_shared_counts_twitter_username' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment