Home

Posted 3 Patches to the Wordpress Project


More for my own records than anyone elses, but I submitted three modification I made to the Wordpress PHP source last night.

Extended get_links() to support link offsets

The first two dealing with setting a list_offset when grabbing a list of links. Wordpress lets you manage your links from within the administratio console, which is nice. However, on the vanilla version of Wordpress when using the get_links() function you always have to get x number of links from the first link. Well I am busy setting up a wordpress blog over at clintology.com and I wanted to implement a layout where initially the first 5 links were shown and through some voodoo magic, if the “more” link a clicked, all of the links were shown (seeing as I have quite a few).

Well that would require that I place links 0 through 5 in one div and links 6 thru N in the other. So I implemented a list_offset parameter in the function and expanded on their use of the SQL parameter LIMIT to get what I needed. Well thats nice but it was only available in code version. What if someone wanted to edit that parameter in the web interface?

Add link_offset editing in the Link Category Editor

This was just a simple addition of table rows and SQL query parameters. It basically lets the user apply a list_offset default to a category. Obviously it can be overwritten by the designer when making their templates.

Import Links from an Uploaded OPML File

This is was the coolest one I thought. In its default state, Wordpress allows the admin of the site to import their Blogrolling links from the Blogrolling site. Well that didn’t really do me a lot of good seeing as I think Blogrolling sucks :) But the framework was in place to recieve an OMPL file and parse it.

I did a bit of editing and was able to add the option of uploading an OPML file exported from your favorite desktop-based aggregator (NetNetsWire, Sharpreader) and have it parsed by Wordpress.