WordPress comment preprocessor
-
I’m writing a script that will filter all comments including the email address, IP and comment text. If any of these match a list that I have generated the comment will not be allowed to be posted (not even as pending approval). The comment will go to never never land; I don’t want this stuff clogging up the database in spam or trash.
The questions:
Which wordpress file do I need to be editing in order to trap any comments being submitted? ~/wp-comments-post.php ?
What wordpress function can I use to grab the post attempt and dump each into variables I can use? Something like:
$email = $_POST[’email’];
$ip = $_POST[‘ip_addr’];
$comment = $_POST[‘ecomment’];Once I have the email, IP, comment in hand, I should be able to process the data using my script.
- The topic ‘WordPress comment preprocessor’ is closed to new replies.