akismet_delete_comment_interval
<?php
/*
Hook: akismet_delete_comment_interval
WordPress version: 4.1
File: wp-content/plugins/akismet/class.akismet.php
The best way to understand what a hook does is to look at where it occurs in the source code.
Action hooks look like this: do_action( "hook_name" )
Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).
*/
$delete_limit = apply_filters( 'akismet_delete_comment_limit', defined( 'AKISMET_DELETE_LIMIT' ) ? AKISMET_DELETE_LIMIT : 10000 );
$delete_limit = max( 1, intval( $delete_limit ) );
/**
* Determines how many days a comment will be left in the Spam queue before being deleted.
*
* @param int The default number of days.
*/
$delete_interval = apply_filters( 'akismet_delete_comment_interval', 15 );
$delete_interval = max( 1, intval( $delete_interval ) );
while ( $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_id FROM {$wpdb->comments} WHERE DATE_SUB(NOW(), INTERVAL %d DAY) > comment_date_gmt AND comment_approved = 'spam' LIMIT %d", $delete_interval, $delete_limit ) ) ) {
if ( empty( $comment_ids ) )
return;
$wpdb->queries = array();
foreach ( $comment_ids as $comment_id ) {