Compatibility: Twitter Tools & Twitter Friendly Links

Due to many requests for twitter friendly links in the Twitter Tools plugin by Alex King I’ve decided to take a look. Alex King surely did a great job in his plugin by leaving a filter which I could use in my plugin without touching the sources of Twitter Tools.

The toughest thing was to find this great wordpress function called url_to_postid() which takes a wordpress URL and tries to convert it into a suitable post ID. It isn’t documented in the codex and I had no idea what keywords to use to find it through Google (was looking for permalink to post id, permalink to id. I’ve highlighted these so that other peeps could find it faster than I did).

Now I’ve got a new function available in my plugin:

echo permalink_to_twitter_link($permalink);

And of course I’ve added an option called “Twitter Tools fix” in the Settings page of the Twitter Friendly Links plugin to let you fellows decide whether you want cool short links or those nasty long ones. I ran a couple of tests on a testing Twitter account, seemed to work fine for me. Comments and suggestions are welcome as usual ;)

The fix was introduced in version 0.3.2. The AJAX/jQuery pagination was also fixed in this release. Available in the WordPress plugin directory.

Cheers!