How to use the URL shortener with

I've written about using and before, but this is how you can use the URL shortener -- if that's your cup of tea. To use the URL shortener, simply add this code to your theme's functions.php file:

function custom_leenkme_url_shortener( $api_url, $url ) {  
	$isgd_api ="";  
	$isgd_args = array(  
				'url' => $url,
				'format' => 'simple'
	return $isgd_api . '?' .  http_build_query( $isgd_args );  
add_filter( 'leenkme_url_shortener', 'custom_leenkme_url_shortener', 10, 2 );  

And that's it. By the way, I'm working on a big update for the plugin, so you won't have to use this code anymore. It will be integrated right into the plugin's user interface.

Let me know if you run into any trouble.

This entry was posted in Custom URL Shorteners, plugin. Bookmark the permalink.

2 Responses to How to use the URL shortener with

  1. Joseph says:

    Lew – I wonder if one might use the same coding for – I’m assuming Google’s URL shortener does not have an API.

    • Lew Ayotte says: does have an API, but it only supports JSON calls, not plain text like most of the other URL shorteners. I will be adding to the next major release of the plugin though, all the URL shortener stuff will be built into the plugin User Interface.