{"id":4731,"date":"2009-09-08T16:22:29","date_gmt":"2009-09-08T22:22:29","guid":{"rendered":"http:\/\/www.casadeblundell.com\/jonathan\/?page_id=4731"},"modified":"2012-03-12T12:21:05","modified_gmt":"2012-03-12T18:21:05","slug":"twitter-link-shortcut","status":"publish","type":"page","link":"http:\/\/casadeblundell.com\/jonathan\/wordpress\/twitter-link-shortcut\/","title":{"rendered":"WordPress Plugin :: Twitter Link Shortcut"},"content":{"rendered":"<p>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.<\/p>\n<p>With a few pointers from <span class=\"twitshort\"><a href=\"http:\/\/www.twitter.com\/spamboy\" target=\"_blank\">@spamboy<\/a><\/span>, and a number of Google searches, (including a great find from <a href=\"http:\/\/scribu.net\/wordpress\/right-way-to-add-custom-quicktags.html\">Scribu<\/a>) I finally figured out the coding and put together a short plugin to share the function with others.<\/p>\n<p>The plugin uses a basic <a href=\"http:\/\/codex.wordpress.org\/Shortcode_API\">shortcode<\/a>:<\/p>\n<p>&#091;twitter]<\/p>\n<p>to wrap around Twitter user names. <\/p>\n<p>The plugin will then output the username with a link to their profile, displaying the standard <span class=\"twitshort\"><a href=\"http:\/\/www.twitter.com\/username\" target=\"_blank\">@username<\/a><\/span> format.<\/p>\n<p>In addition, the links can be styled via your sites CSS, using the .twitshort selector.<\/p>\n<p>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&#8217;ll ensure the site doesn&#8217;t link somewhere it shouldn&#8217;t on accident.<\/p>\n<h2>Download the plugin<\/h2>\n<p><a href=\"http:\/\/wordpress.org\/extend\/plugins\/twitter-link-shortcut\/\" title=\"download from wordpress.org\" target=\"_blank\">Download the plugin from WordPress.org<\/a><br \/>\nor search for &#8220;Twitter Link Shortcut&#8221; from within your WordPress plugin menu (under &#8220;Add New Plugin&#8221;).<\/p>\n<h2>Screenshots<\/h2>\n<div class=\"tiled-gallery type-rectangular tiled-gallery-unresized\" data-original-width=\"660\" data-carousel-extra='null' itemscope itemtype=\"http:\/\/schema.org\/ImageGallery\" > <div class=\"gallery-row\" style=\"width: 660px; height: 313px;\" data-original-width=\"660\" data-original-height=\"313\" > <div class=\"gallery-group images-1\" style=\"width: 423px; height: 313px;\" data-original-width=\"423\" data-original-height=\"313\" > <div class=\"tiled-gallery-item tiled-gallery-item-large\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"http:\/\/casadeblundell.com\/jonathan\/wordpress\/twitter-link-shortcut\/screenshot-2\/\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"419\"> <meta itemprop=\"height\" content=\"309\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"4732\" data-orig-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2.png\" data-orig-size=\"301,222\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Twitter Link Shortcode screenshot 2\" data-image-description=\"\" data-medium-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2-300x221.png\" data-large-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2.png\" src=\"https:\/\/i0.wp.com\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2.png?w=419&#038;h=309\" srcset=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2.png 301w, http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-2-300x221.png 300w\" width=\"419\" height=\"309\" loading=\"lazy\" data-original-width=\"419\" data-original-height=\"309\" itemprop=\"http:\/\/schema.org\/image\" title=\"Twitter Link Shortcode screenshot 2\" alt=\"Example of the plugin&#039;s output\" style=\"width: 419px; height: 309px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> Example of the plugin&#8217;s output <\/div> <\/div> <\/div> <!-- close group --> <div class=\"gallery-group images-2\" style=\"width: 237px; height: 313px;\" data-original-width=\"237\" data-original-height=\"313\" > <div class=\"tiled-gallery-item tiled-gallery-item-small\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"http:\/\/casadeblundell.com\/jonathan\/wordpress\/twitter-link-shortcut\/screenshot-1\/\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"233\"> <meta itemprop=\"height\" content=\"150\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"4733\" data-orig-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1.png\" data-orig-size=\"362,233\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Twitter Link Shortcode screenshot 1\" data-image-description=\"\" data-medium-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1-300x193.png\" data-large-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1.png\" src=\"https:\/\/i0.wp.com\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1.png?w=233&#038;h=150\" srcset=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1.png 362w, http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-1-300x193.png 300w\" width=\"233\" height=\"150\" loading=\"lazy\" data-original-width=\"233\" data-original-height=\"150\" itemprop=\"http:\/\/schema.org\/image\" title=\"Twitter Link Shortcode screenshot 1\" alt=\"How the shortcode appears in the post editor\" style=\"width: 233px; height: 150px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> How the shortcode appears in the post editor <\/div> <\/div> <div class=\"tiled-gallery-item tiled-gallery-item-small\" itemprop=\"associatedMedia\" itemscope itemtype=\"http:\/\/schema.org\/ImageObject\"> <a href=\"http:\/\/casadeblundell.com\/jonathan\/wordpress\/twitter-link-shortcut\/screenshot-3\/\" border=\"0\" itemprop=\"url\"> <meta itemprop=\"width\" content=\"233\"> <meta itemprop=\"height\" content=\"155\"> <img decoding=\"async\" class=\"\" data-attachment-id=\"4736\" data-orig-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3.png\" data-orig-size=\"583,386\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Twitter Link Shortcode screenshot 3\" data-image-description=\"\" data-medium-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3-300x198.png\" data-large-file=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3.png\" src=\"https:\/\/i0.wp.com\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3.png?w=233&#038;h=155\" srcset=\"http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3.png 583w, http:\/\/casadeblundell.com\/jonathan\/wp-content\/uploads\/screenshot-3-300x198.png 300w\" width=\"233\" height=\"155\" loading=\"lazy\" data-original-width=\"233\" data-original-height=\"155\" itemprop=\"http:\/\/schema.org\/image\" title=\"Twitter Link Shortcode screenshot 3\" alt=\"How the twitter button now appears in version 1.0.1\" style=\"width: 233px; height: 155px;\" \/> <\/a> <div class=\"tiled-gallery-caption\" itemprop=\"caption description\"> How the twitter button now appears in version 1.0.1 <\/div> <\/div> <\/div> <!-- close group --> <\/div> <!-- close row --> <\/div>\n<h2>Installation<\/h2>\n<p>1. Upload &#8216;twitlinkshortcode&#8217; directory to the &#8216;\/wp-content\/plugins\/&#8217; directory<br \/>\n2. Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress<\/p>\n<h2>Usage<\/h2>\n<p>1. Once it&#8217;s installed a quicktag\/button labled &#8220;twitter&#8221; will display in your post\/page edit toolbar. Clicking the link will insert the &#091;twitter] and &#091;\/twitter] shortcode into your post\/page. Simply insert the Twitter user&#8217;s name between the two short codes and the plugin will take care of the rest.<br \/>\n2. You can also insert the shortcode manually around the Twitter username you wish to link to. <\/p>\n<p>Example: &#091;twitter]jdblundell&#091;\/twitter]<\/p>\n<h2>Changelog<\/h2>\n<p><strong>1.0.3<\/strong><br \/>\nRemoved whitespace within PHP file to repair RSS validation errors.<\/p>\n<p><strong>1.0.2<\/strong><br \/>\nError in the code kept the WordPress Post Preview function from working properly. Corrected code to ensure full compatibility.<\/p>\n<p><strong>1.0.1<\/strong><br \/>\nAdded 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.<\/p>\n<p><strong>1.0.0<\/strong><br \/>\nThis is the initial release.<\/p>\n<h2>Yes, it&#8217;s FREE!<\/h2>\n<p>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&#8217;t required for you to use this plugin. <\/p>\n<p>Think of it as encouraging my edumacation, as I&#8217;m learning this as I go. <\/p>\n<p>If you&#8217;re feeling generous, you can just buy me a beer (click the Paypal link below) or support our local <a href=\"http:\/\/redoakllp.wordpress.com\/donate\/\">Laundry Love People<\/a>.<\/p>\n<form action=\"https:\/\/www.paypal.com\/cgi-bin\/webscr\" method=\"post\">\n<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><br \/>\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"8076317\"><br \/>\n<input type=\"image\" src=\"https:\/\/www.paypal.com\/en_US\/i\/btn\/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"https:\/\/www.paypal.com\/en_US\/i\/scr\/pixel.gif\" width=\"1\" height=\"1\"><br \/>\n<\/form>\n<p>Thanks and I hope you enjoy this plugin!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 , and a number of Google searches, (including a great &hellip; <a href=\"http:\/\/casadeblundell.com\/jonathan\/wordpress\/twitter-link-shortcut\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WordPress Plugin :: Twitter Link Shortcut<\/span><\/a><\/p>\n","protected":false},"author":84,"featured_media":0,"parent":9124,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-4731","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/PEnSo-1ej","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/pages\/4731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/comments?post=4731"}],"version-history":[{"count":0,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/pages\/4731\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/pages\/9124"}],"wp:attachment":[{"href":"http:\/\/casadeblundell.com\/jonathan\/wp-json\/wp\/v2\/media?parent=4731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}