urlparse WordPress Plugin - tuesday 2005-12-06 2308 last modified 2005-12-06 2308
Categories: Nerdy
TrackBacks Sent: None

Cross posting is somewhat problematic since posts may contain relative links that will go nowhere when cross posted. This plugin provides a library to turn all relative links in well-formed HTML to absolute links. It is inexplicable to me why neither PHP nor WordPress provide such a basic URL resolution function. The code is translated from the Python 2.3.5 distribution and also includes code derived from Simon Ronnqvist's Smarty plugin.

urlparse is a library, it provides functions for other plugins to call and provides no hooks of its own. To use, download it into your plugins directory and activate it.

The main function is called urlparse_external_links and takes a block of content and the ID associated with the post and returns a new block of content with relative links transformed to absolute links.

Plugins like Blogger API Client are ready for urlparse support and merely need to have the correct line uncommented for the function to be activated.

urlparse is released under the Python Software Foundation License as included for Python 2.3.5.

You must login to leave a comment


No TrackBacks for this entry.