BCTT Tutorial: Changing the “via username” on a Per-Box basis.
As of version 4.7, users of my popular Better Click To Tweet WordPress Plugin have the ability to programmatically change the “via @username” on a per-box basis. Here’s how that works:
If you use the visual editor, clicking the little blue birdie icon will produce the pop-up that you are used to, with one important difference. Now, instead of a simple checkbox to enable or disable the “via,” it gives the option to change the username as well.
The username field pre-populates with the Twitter username you have set in the settings page for the plugin, if you have set that. If you uncheck the box, no username will be appended to the tweet when a user tweets, even if you you leave the username in the text field.
If you are using the text editor, here’s how to formulate the new shortcode:
[bctt tweet="some compelling quote from Guest Poster." username="guestposter"]
Note: If you use the shortcode attribute via="no"
then no matter what you put in the username attribute, the plugin will ignore it; via="no"
is an override-style attribute that will remove any username from the tweet.