WordPress Plugin :: Twitter Link Shortcut

After linking to Twitter usernames in my my blog posts, one too many times, I decided to take a hack at writing my first WordPress Plugin to help alleviate the annoyance of typing out the hyperlink each and every time.

With a few pointers from @spamboy, and a number of Google searches, (including a great find from Scribu) I finally figured out the coding and put together a short plugin to share the function with others.

The plugin uses a basic shortcode:

[twitter]

to wrap around Twitter user names.

The plugin will then output the username with a link to their profile, displaying the standard @username format.

In addition, the links can be styled via your sites CSS, using the .twitshort selector.

There are several other plugins that create these links automatically, but I decided the better route, for my use, would be through using shortcodes. That way it’ll ensure the site doesn’t link somewhere it shouldn’t on accident.

Download the plugin

Download the plugin from WordPress.org
or search for “Twitter Link Shortcut” from within your WordPress plugin menu (under “Add New Plugin”).

Screenshots

Installation

1. Upload ‘twitlinkshortcode’ directory to the ‘/wp-content/plugins/’ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress

Usage

1. Once it’s installed a quicktag/button labled “twitter” will display in your post/page edit toolbar. Clicking the link will insert the [twitter] and [/twitter] shortcode into your post/page. Simply insert the Twitter user’s name between the two short codes and the plugin will take care of the rest.
2. You can also insert the shortcode manually around the Twitter username you wish to link to.

Example: [twitter]jdblundell[/twitter]

Changelog

1.0.3
Removed whitespace within PHP file to repair RSS validation errors.

1.0.2
Error in the code kept the WordPress Post Preview function from working properly. Corrected code to ensure full compatibility.

1.0.1
Added a quicktag link within the post/page toolbar. The link inserts the twitter shortcode into the post, without the need to manually type the code.

1.0.0
This is the initial release.

Yes, it’s FREE!

In keeping with the spirit of WordPress, this plugin is free to use by anyone and everyone. You are welcome to use it however you want. However, I do appreciate donations for my time and effort, although they obviously aren’t required for you to use this plugin.

Think of it as encouraging my edumacation, as I’m learning this as I go.

If you’re feeling generous, you can just buy me a beer (click the Paypal link below) or support our local Laundry Love People.





Thanks and I hope you enjoy this plugin!

4 thoughts on “WordPress Plugin :: Twitter Link Shortcut”

Share your thoughts and snarky comments...