Custom WordPress shortcode that allows the user to easily insert their Twitter URL as a link by typing [mh_twitter] into a WordPress post.
Using just [mh_twitter] will display the default username and message ‘Follow me on Twitter’ into the post.
By adding attributes to the shortcode the user can customize both the Twitter username/profile link and the link text.
[mh_twitter username="somename"] will overwrite the profile link but keep the default text. The HTML would look like this
<a href="http://twitter.com/somename">Follow me on Twitter</a>
[mh_twitter username="somename"]Please follow me on Twitter[/mh_twitter] will overwrite both the profile link and the link text. The HTML would look like this
<a href="http://twitter.com/somename">Please follow me on Twitter</a>