Widgets User Interface and API

I don’t have a lot to tell you here but I wanted to give you a peek at the interface we’ve been developing for WordPress Widgets. It’s not final but it’s working and if I may be the first to say so, it’s damn sexy! Of the top four browsers, FF/IE/O8/Safari, I have coaxed the script to work nicely with three of them and Matt reports that it works in Safari on his new Intel Mac Mini. Here’s the screenshot:

Widgets Screenshot

This week should see the release of WordPress Widgets as a plugin for everyone to use and play with. As a result, you’re going to see new widgets flying out faster than you can catch them. The API has become a thing of power and simplicity, enabling developers to write new widgets in minutes. My favorite part is either the popup configuration forms like the del.icio.us box shown, which can be made with fewer than 20 lines of code, or the little buttons you click to pop the forms up.

One included widget is simply called Text. You can have as many as nine of these at a time and put whatever you want in them (if you have the unfiltered_html capability). Complex things like Flickr badges will be easiest to deploy into badges this way: just paste the code from Flickr into the popup form. Of course, if someone named Owen happened to write an AJAX flickr badge script generator, nobody would complain. 😉

Also of great importance is the ease of integrating this plugin with existing themes. It’s about as much work as adding three template tags and I’ll be publishing the full directions soon. Most of the included widgets will work with any theme but some widgets, due to legacy code in template tags, which will be updated in WordPress 2.1, will not. Theme authors can override any built-in widget with their own version if they like.

I told you I didn’t have much to say and then I went and spilled all the beans. Of course, none of the above is true or final, so bear with us as we make it so.

17 thoughts on “Widgets User Interface and API”

  1. Good work Andy, looks exciting… Curious about the configuration optionsfor the ‘categories’ widget item. I’m hoping that this will allow me to customize the sort-order/hierarchy?

    I’ve actually written some code to do that, but was holding back to see if you guys had already done it… let me know if you want the code?

  2. Pingback: 463f9ef32b

Comments are closed.