In reply to Jason Lemieux.

Yeah, I thought of way to do this last night (by hooking into comment being posted and querying DB myself, instead of filtering core's query). Here is some proof of concept code that does it:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

Show hidden characters

<?php

function filter_handler( $approved , $commentdata ) {

// get the comment author name and email and check how many comments that person has approved.

global $wpdb;

$author = $commentdata[ 'comment_author' ];

$email = $commentdata[ 'comment_author_email' ];

$comments_approved = $wpdb->get_var( "SELECT COUNT(comment_approved) FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' LIMIT 1" );

// if the author already has more than 5 comments approved, set this to approved, otherwise set as pending

if ( 5 < $comments_approved ) {

$approved = 1;

}

else {

$approved = 0;

}

// return the approved value

return $approved;

}

add_filter( 'pre_comment_approved' , 'filter_handler' , '99', 2 );

?>

view raw

comment_auto_approval.php

hosted with ❤ by GitHub

The 5 (previous comments approved) is hard coded here, but if people are interested I could turn it into a plugin and make it a setting.

And if you want to add it Epoch in any fashion whatsoever, feel free! :)