Posthaste WP Plugin

Update 12-22-2008: Ok, posthaste is now in the WordPress Plugin directory. You can also fork it on github.

If you have any questions, suggestions or comments, leave them there from now on. I’ll follow anything posted there and try to respond quickly.

I’ll keep this post up, but I don’t plan on updating it every time I update the plugin. For information about updates, you should follow the Release Notes at wordpress.org.


When reworking the theme for this blog, I decided I wanted to add the Twitter-style quick post box from the Prologue theme to my theme. Instead of adding it directly to my theme though, I decided to try to write it as a plugin. Lo and behold, I succeeded:

A screenshot of the Posthaste plugin on this blog

I don’t know why—it’s not that much work to use the WP admin backend—but this seems to make blogging seem much more inviting to me. I basically just took the relevant code from the Prologue theme, modified it a bit (adding a “Title:” field, for example) and found the correct WP hooks to put it in Plugin form.

I’m actually thinking about releasing it as a real plugin. When I mentioned this to my friend James, he recommended the name “Posthaste.” James is much better at naming things than me, so I took his recommendation.

If this sounds interesting to you, you can download it and try it out. If it seems useful to other people & actually works well enough, I may submit it to the WP plugin directory. I tested it with a handful of the most popular themes on the WordPress Theme Directory and it seemed to work with them all.

A few notes:

Comments

I moved this blog off WordPress and lost the comments. There were several cool tips for hacking the plugin in the comments, so I thought I’d preserve some of them here. Ideally, many of these will be incorporated into the plugin soon, but in the meantime, I’ll leave them here.

Can you add feature X?

There are a few features I do want to add. In order of likelihood that I’ll actually add them:

Two factors are slowing down adding any of these: 1) I’m not a full-time programmer. Not even really a part-time programmer. This is a hobby for me, so I can’t guarantee I’ll get to anything all that soon.

Also, I should add that I really do want to keep the plugin as simple as possible. If you need a full featured environment, just use the edit page. The point of posthaste is, as the name implies, to make posting as easy and streamlined as possible. And all the “features” of the WordPress admin interface is precisely what makes it such a pain to go to just for a quick post. That’s not to say any of these ideas are bad ideas (a media uploader would just add a single icon, quick tag buttons can look nice enough…and all of these would be optional anyway), but when requesting new features it’s good to know where I’m coming from on this.

Can I change the location of the form?

This is the most common request and it’s the first improvement on my todo list. It’s also very easy to just quickly do yourself if you don’t mind modifying some php.

Just find the two locations of is_home() and change them accordingly. For example, to make the form show up on a specific page, use is_page('pagename') or on a specific category page, use is_category('7').

Next, you should change the action from bloginfo('url') to the category of the page you’re on. Or, really, just making it empty (“”) should work.

Finally, if you want to be redirected back to the page where you submitted the post, you need to change the wp_redirect() at the very end of the header function.