I am looking into WP_query,
if you are in a hurry feel free to change this while loop
if ($post_date_plus_visibleperiod < $now) {
// GOGOGO !
$this->delete_post_and_attachments($post->ID,$force_delete);
// Mail admin?
if(!empty($this->conf['settings']['admin_email']))
{
$body = "Deleting post ID : ".$post->ID. "\n";
$body .= "Post title : ".$post->post_title. "\n";
$body .= "Settings (Delete or Trash) : ".( ($force_delete) ? 'Delete' : 'Trash' ). "\n";
wp_mail($this->conf['settings']['admin_email'],'Plugin auto prune posts notification',$body);
}
}
adding an if statement based on post->comment_count
I’ve written a patch for WordPress Core and hope to submit it real soon.