Action hooks! http://wiki.wordpress.org/Plugin/API
I think add_action('publish_post', 'my_function'); is what you want. I believe there is a bug that trips this when a post is published AND edited… I might be wrong, so you could also try add_action('edit_post', 'my_function');. Using both wouldn’t hurt. 🙂
OK, so I’ve created the plugin, made a function, and declared add_action on publish_post — how do I access the post title and post body in the function?
(By the way, what I’m trying to do is convert a few windows-1252 characters that frequently show up on our blog — such as em-dash and smart quotes — into UTF-8.)
This seems to be the only post that comes close to what I want to do, but frankly I dont’ get it! :\
What I want to do is simply change bad words to asterisks or otherwise blot them out in ALL posts — or moderate posts that have them.
I want to create an open forum where anyone can post (not just comment), but the filters built into WP are only on comments, not posts.
I have downloaded Dougal’s pirate filter (so very cool! :)), but it seems to only work on a per-post basis (or at least, that is all the instructions explain). I want something for all posts. I like the moderation fucntion on comments in WP, but is there a way to apply it to posts?