Wanted: Excerpt Exacter
Published 15 years, 10 months pastSo after I once again published a post without filling in the excerpt, thus forcing me to go back to fill it in later, I tweeted in a fit of pique:
I need a WordPress plugin that won’t let me publish a post until I’ve filled in the excerpt field. Anyone got one?
To which I got a whole lot of responses saying, in effect, “Oooo! Good idea! I need that too! Let me know when you find one!” Some of them came from people running fairly high-profile blogs. The need clearly exists. A couple of responses were of the “I could do that!” variety, so I thought I’d post here so as to describe how I think it ought to work from the user’s perspective, and then we can hash things out in comments and someone can code it up and make everyone happy.
So really what I want is, when I push the “Publish” button in WordPress, the plugin checks to see if there’s an excerpt. If not, one of two things happens:
The plugin throws up a warning dialog telling me that I’m about to post without an excerpt (again). If I say “Okay”, it goes ahead with publishing. If I say “Cancel”, it returns me right back to where I was, which is the “Write Post” page, with all the data intact and unaltered.
The plugin returns me to the “Write Post” page with all data intact and unaltered, and puts an error box at the top of the page telling me I forgot to write an excerpt (again) and that it won’t let me publish until I fix the problem.
One or the other. I think I like #1 a little better, but I’d be good either way. I’m open to other approaches as well, but I don’t think the plugin should rely on JavaScript, as that means leaving out people who don’t enable JavaScript or post from JS-incapable devices.
I would do this myself, but I’m a little wary of the “return to the page with all data intact and unaltered” bit, which I would imagine is pretty easy to mess up. Thus I’m putting it up here as a semi-Lazyweb post so that someone else, someone with more experience with WordPress and plugin authoring, can do it right and quickly.
Okay, who’s on it?