Wordpress 2.2

Not exactly news but, 17 days ago Wordpress 2.2 was released. Just a few days ago, I upgraded to this version. I actually didn’t mean to but a debacle I made while doing some maintenance forced me to do so.

There are a lot of fixes in this version, but the best thing is that widgets are a core part of this release. You don’t need the widget plugin anymore, but your old widgets may not be compatible with 2.2. I found that for plugins that pass parameters to widgets at registration time, won’t work. Apparently the signature for ‘register_sidebar_widget’ has changed. It now has 4 parameters instead of 3.

The old signature looks like this:
void register_sidebar_widget ( string name, callback [, string classname ] )

The new looks something like this:
void register_sidebar_widget ( string name, callback [ x, [, string classname ]] )

Notice that there is a possible new parameter but, it is not added at the end but before the classname param. If you are calling it the old way your value won’t get passed in. And if your widget code is expecting a parameter it will error out. Passing in a null value for the third field, fixes this problem. Like so:

register_sidebar_widget(array("BTW '$title'"), array('BH_Text','widget'), null, $title);

I don’t know what this new param, is used for yet.

Share and Enjoy:
  • del.icio.us
  • Reddit
  • Digg
  • Slashdot
  • StumbleUpon
  • Facebook
  • Google
  • Technorati
  • Live
  • e-mail

2 Responses to “Wordpress 2.2”

  1. Eastboy301 Says:

    YO whaddup,

    I was looking for a way to contact you personally but couldn’t find one. I’m looking for someone like you to partner up with me to help maintain this very large message board I own. Its a very live place for people of color to come and discuss the latest issues, trade music, post album reviews, rate movies, etc. The website is http://www.streetmixed.com and I am anxious to find some moderators and adminstrators for it and its geared to the same audience your blog focuses on. If you are interested please email me.

    This is not spam or anything, so feel free to contact me.

  2. BH Says:

    Thanks for the offer Eastboy. I’ll take under advisement.

Leave a Reply