Reply To: Post submission hooks
Ya ok i got something figured out. its very basic but you can easily add to this. here’s the code
This basically ads a field call ‘lp_post_honey_post’ with the question “I am a robot”. if the user answers anything other than ‘no’ the post craps out with an error. currently the error message is that the post parameters are wrong, but maybe if somebody can tell me how to set the bbpress error message I can fix that.
You can see the filter in action here
http://www.thelightningpath.com/forums/room/lobby/pre-registration/
There are a few tweaks you could make to this. if you have a plugin like piklist you can easily have a settings page where you could set both the question and the answer. And of course you can change the question in the hard code.
I choose the wp_insert_post_empty_content filter because it fires early on in the wp_update_post routine, saving some CPU cycles.
If somebody wants to help me set this up as a wordpress plugin we could make this a plugin pretty easily. I’m guessing there would be a lot of interest in this.
incorrect code removed ! - correct version below