I'm looking into building a plugin to activate on a system that would stop WordPress to publish a post if some criteria aren't met.
Now, after reading some of the codex, I began to see a solution coming: I would plugin into action "publish_post", verify if it's the first time it get published (something I need) then run my function (let's say check if my title contains a minimum number of characters). Now, if it does: go on, else, send an error and do not post the post to DB.
But I'm stuck on that last part: stoping the process of posting an article on a given condition, and returning to the page with an error. Maybe I'm just blinded by fatigue, but I can't seem to find the right solution lurking into the codex...
Can anyone points me to the right way of acheiving this?