[wp-hackers] Best way to 'enhance' wp-comments-post.php

Austin Matzko if.website at gmail.com
Thu May 25 21:03:37 GMT 2006


On 5/25/06, Eric A. Meyer <eric at meyerweb.com> wrote:
>     I considered 'preprocess_comment' since that's what Akismet uses,
> but wasn't sure if it was the best choice.  Anyone have a compelling
> explanation of which would be better, 'preprocess_comment' or 'init'?
> Or if there's something even better?

I think preprocess_comment is best for 2 reasons:
1) It doesn't fire off for *every* WordPress request, as does init, so
you're not wasting processing resources.
2) Of the filters/actions that do fire off only when a comment is
submitted to wp-comments-post.php, it's the first (assuming the
spammer hasn't left off any requisite fields, such as an email
address).


More information about the wp-hackers mailing list