Porting Wordpress 2.7 widgets to Wordpress 2.8, part 2: a random photo widget

June 17th, 2009 at 8:16 pm

If you read part 1 of my tutorial, you’d hopefully know how to port a simple display widget from the Wordpress 2.7 procedural widget API to the new Wordpress 2.8 object-oriented widget API. You’d also know a little about why coding widgets are better than slapping a bunch of code in your sidebar. You did read it, right? No? I’ll wait, I’ve got time.

Okay, good. The part we didn’t cover because it would have made the tutorial ridiculously long was porting configurable forms for the widget admin area. So that’s what this part is about.

Read the rest of this entry »

Porting Wordpress 2.7 widgets to Wordpress 2.8, part 1: a simple blogroll widget

June 14th, 2009 at 10:09 pm

Wordpress 2.8 introduces a new object-oriented Widget API (based on Alex Tingle’s MultiWidget class) which is an improvement over the procedural API for Wordpress 2.7 and before. It’s not a revolutionary leap, but it does make coding widgets which need to appear multiple times on a page easier, automates some administrative form handling, and makes code better-organized and easier to follow.

The bad news is the new API isn’t backwards compatible without a little work. So here is the first part of a multi-part guide for porting a Wordpress 2.7 widget over to the new Wordpress 2.8 API.

Read the rest of this entry »

Housekeeping notes

June 11th, 2009 at 11:11 pm

I upgraded to Wordpress 2.8 which mostly went fine except that it blew up about half the widgets in my sidebar due to a completely new widget API. I eventually will get around to updating these, which will give me an excuse to write a technical post.

This was the first time I used the Automatic Upgrade in the admin instead of doing the upgrade through SSH, and it seemed to have gone off without a hitch. So yay for that.