A long time ago, I unleashed on the world my first (and so far only) WordPress plugin: List Draft Posts. It’s a simple thing that lists the titles of any posts that you’ve started on but not yet posted. Simple is the only kind of coding I can generally manage, so it’s stayed simple, the only bit of sophistication being a form to control the layout it uses. But it works for me, and it’s possible that one or two of the 239 people who’ve downloaded it from the WordPress plugin repository might be using it.
But it did lack one thing: it couldn’t be used as a WordPress widget. Well, there are ways of using a special widget to run a plugin’s function, but that’s not the same thing, is it? Having started to move my site to widgets, I decided to learn how to turn my own simple plugin into a widget, and started searching.
And that was a bit tricky at first. Some documentation I found assumed rather too much in the way of coding knowledge, and missed out some details that would be needed if you actually wanted your widget to work. But after a while, I found a post by Kaf: My Widget – example WordPress Widget. This, together with some changes suggested in the comments enabled me to get to work. After a lot of fiddling, tweaking, head-scratching, editing, re-editing and muttering, I managed to create a new version of List Draft Posts that is entirely widgety. Someone who knows how to code could probably make a version that would work as either a plugin or a widget, but for now I’m going to leave it as two separate versions.
As a standard widget, it doesn’t need much configuration – you can enter a heading to go above the list of posts, and a description for any draft posts that don’t have titles. It outputs its stuff in an unordered list below the heading:
<ul> <li>A post I need to finish</li> <li>Another post I've started</li> </ul>
I’m going to play with it a bit more, make sure it doesn’t break anything, then submit it to the repository. If anyone desperately wants it before then, leave a comment, and I’ll make it available by some means or other.
Update: You can now get the widget from the official repository: List Drafts Widget
 In internet time
 And that lacks a lot of sophistication itself
 Hi guys