What's a good plug-in that taps into the update post or save post action that allows admins to enforce rules such as if a user selects a category with the ID 5 then he also has to select at least one category from the the XYZ custom taxonomy etc - or that update/save won't go thru.

I'd like to write my own rules as to who ( which roles ) can do what and so on.

My plan is this. Get a well-written plug-in and use that as the boiler plate for customizations. So, I can just go into the source code of that plug in and inject all kinds of business logic that is specific to my web site.

Any leads towards this goal is really appreciated.


I don't know of any plugins that do this, and I'm not sure you'll find one. The closest I can find is the "Mandatory Field" plugin. The specific tasks that you might want are so varied, that I wonder whether a non-bloated plugin that let you customize the validation is out there.

With that said, you'll want to look into the save_post hook. There are quite a few questions about that hook on this very site (such as this one). If you're looking for a code-snippet to modify, I'd start by looking through those questions.

Also, even if you do manage to write a good validation plugin with the save_post hook (btw, I'd use the term "validation" in your future questions and queries as that's really what you're trying to accomplish), I'd consider augmenting it with some client-side jQuery validation. I'd imagine it would be very annoying to have the "Publish" or "Update" button not take the expected action since this is a relatively rare feature to add to a WordPress site. By creating some live validation (backed up by the server-side stuff) would be a much better user experience.

  • mrwweb, congratulations on your 2k, cool! – brasofilo Jun 1 '12 at 2:15

I know that Advanced Custom Fields does that.
I keep citing it, but I promise I'm not affiliated...

enter image description here From a fast analysis, this is the code that does it, but couldn't track how it's being hooked...

$('form#post').live("submit", function(){

    if(acf.valdation == false)
        // reset validation for next time
        acf.valdation = true;

        // show message
        $(this).before('<div id="message" class="error"><p>' + acf.validation_message + '</p></div>');

        // hide ajax stuff on submit button

        return false;


    // submit the form
    return true;        

Not the answer you're looking for? Browse other questions tagged or ask your own question.